Пример #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
/**
 * update.php - FaxMaster update script
 *
 */
function faxmaster_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '0.1.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/faxmaster/boost/update-0.1.1.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/faxmaster/boost/update-0.1.2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.3', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('faxmaster', $content);
        case version_compare($currentVersion, '0.1.5', '<'):
            PHPWS_Settings::set('faxmaster', 'fax_path', '/var/fax/');
            PHPWS_Settings::save('faxmaster');
        case version_compare($currentVersion, '0.1.6', '<'):
            $content[] = '<pre>';
            slcUpdateFiles(array('class/FaxPager.php', 'class/Faxmaster.php', 'templates/faxList.tpl', 'templates/style.css', 'templates/statistics.tpl'), $content);
            $content[] = '0.1.6 Changes
---------------
+ Added a statistics page to view monthly fax stats.
+ Added CSV export to the new statistics page.</pre>';
        case version_compare($currentVersion, '0.1.7', '<'):
            $content[] = '<pre>';
            // Add 2 new columns to the database related to archiving
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/faxmaster/boost/update-0.1.7.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            slcUpdateFiles(array('boost/boost.php', 'boost/install.sql', 'boost/permission.php', 'boost/update.php', 'boost/update-0.1.7.sql', 'class/ArchiveDownload.php', 'class/exception/InstallException.php', 'class/Fax.php', 'class/FaxPager.php', 'class/Faxmaster.php', 'inc/settings.php', 'templates/archivePager.tpl', 'templates/faxList.tpl', 'templates/settings.tpl', 'templates/style.css'), $content);
            $content[] = '0.1.7 Changes
---------------
+ Added an archive method that is only accessbile by URL.
+ Added the ability to Download an Archive file.
+ Added permissions related to archiving and settings.
+ Added 2 database columns needed for archiving.
+ Added a View Archive page to view a list of all archived faxes.
+ Added a Settings page to configure the fax and archive paths.
</pre>';
        case version_compare($currentVersion, '0.1.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/faxmaster/boost/update-0.1.8.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
    }
    return true;
}
Пример #3
0
/**
 * @author Chris Detsch
 */
function appsync_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '0.1.2', '<'):
            Users_Permission::registerPermissions('intern', $content);
        case version_compare($currentVersion, '0.1.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.00.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
    }
    return true;
}
Пример #4
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;
}
Пример #5
0
 /**
  * Creates the permission menu template
  */
 public static function permissionMenu(Key $key, $popbox = FALSE)
 {
     $edit_groups = Users_Permission::getRestrictedGroups($key, TRUE);
     if (PHPWS_Error::isError($edit_groups)) {
         PHPWS_Error::log($edit_groups);
         $tpl['MESSAGE'] = $edit_groups->getMessage();
         return $tpl;
     }
     $view_groups = User_Form::_getNonUserGroups();
     $view_matches = $key->getViewGroups();
     $edit_matches = $key->getEditGroups();
     if (!empty($edit_groups)) {
         $edit_select = User_Form::_createMultiple($edit_groups['restricted']['all'], 'edit_groups', $edit_matches);
     } else {
         $edit_select = null;
     }
     if (!empty($view_groups)) {
         $view_select = User_Form::_createMultiple($view_groups, 'view_groups', $view_matches);
     } else {
         $view_select = null;
     }
     $form = new PHPWS_Form('choose_permissions');
     $form->addHidden('module', 'users');
     $form->addHidden('action', 'permission');
     $form->addHidden('key_id', $key->id);
     $form->addRadio('view_permission', array(0, 1, 2));
     $form->setExtra('view_permission', 'onclick="hideSelect(this.value)"');
     $form->setLabel('view_permission', array(dgettext('users', 'All visitors'), dgettext('users', 'Logged visitors'), dgettext('users', 'Specific group(s)')));
     $form->setMatch('view_permission', $key->restricted);
     $form->addSubmit(dgettext('users', 'Save permissions'));
     if ($popbox) {
         $form->addHidden('popbox', 1);
     }
     $tpl = $form->getTemplate();
     $tpl['TITLE'] = dgettext('users', 'Permissions');
     $tpl['EDIT_SELECT_LABEL'] = dgettext('users', 'Edit restrictions');
     $tpl['VIEW_SELECT_LABEL'] = dgettext('users', 'View restrictions');
     if ($edit_select) {
         $tpl['EDIT_SELECT'] = $edit_select;
     } else {
         $tpl['EDIT_SELECT'] = dgettext('users', 'No restricted edit groups found.');
     }
     if ($view_select) {
         $tpl['VIEW_SELECT'] = $view_select;
     } else {
         $tpl['VIEW_SELECT'] = dgettext('users', 'No view groups found.');
     }
     if ($popbox) {
         $tpl['CANCEL'] = sprintf('<input type="button" value="%s" onclick="window.close()" />', dgettext('users', 'Cancel'));
     }
     if (isset($_SESSION['Permission_Message'])) {
         $tpl['MESSAGE'] = $_SESSION['Permission_Message'];
         unset($_SESSION['Permission_Message']);
     }
     return $tpl;
 }
Пример #6
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function pagesmith_update(&$content, $currentVersion)
{
    $home_dir = PHPWS_Boost::getHomeDir();
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.0.1', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('ps_page');
            $result = $db->addTableColumn('front_page', 'smallint NOT NULL default 0');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = "--- Unable to create table column 'front_page' on ps_page table.</pre>";
                return false;
            } else {
                $content[] = "--- Created 'front_page' column on ps_page table.";
            }
            $files = array('templates/page_list.tpl', 'javascript/update/head.js', 'conf/error.php', 'templates/page_templates/simple/page.tpl', 'templates/page_templates/twocolumns/page.tpl');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_1.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.2', '<'):
            $content[] = '<pre>';
            $dest_dir = $home_dir . 'javascript/modules/pagesmith/passinfo/';
            if (!is_dir($dest_dir)) {
                if (is_writable($home_dir . 'javascript/modules/pagesmith/') && @mkdir($dest_dir)) {
                    $content[] = '--- SUCCEEDED creating "javascript/modules/passinfo/" directory.';
                } else {
                    $content[] = 'PageSmith 1.0.2 requires the javascript/modules/pagesmith/ directory be writable.</pre>';
                    return false;
                }
            } elseif (!is_writable($dest_dir)) {
                $content[] = 'PageSmith 1.0.2 requires the javascript/modules/pagesmith/passinfo/ directory be writable.</pre>';
                return false;
            }
            $source_dir = PHPWS_SOURCE_DIR . 'mod/pagesmith/javascript/passinfo/';
            if (!PHPWS_File::copy_directory($source_dir, $dest_dir)) {
                $content[] = "--- FAILED copying to {$dest_dir}.</pre>";
                return false;
            } else {
                $content[] = "--- SUCCEEDED copying to {$dest_dir} directory.";
            }
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_2.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.3', '<'):
            $content[] = '<pre>';
            $source_dir = PHPWS_SOURCE_DIR . 'mod/pagesmith/templates/page_templates/text_only/';
            $dest_dir = $home_dir . 'templates/pagesmith/page_templates/text_only/';
            if (PHPWS_File::copy_directory($source_dir, $dest_dir)) {
                $content[] = "--- Successfully copied {$source_dir}\n    to {$dest_dir}\n";
            } else {
                $content[] = "--- Failed to copy {$source_dir} to {$dest_dir}</pre>";
                return false;
            }
            $files = array('conf/config.php');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_3.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.4', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('phpws_key');
            $db->addWhere('module', 'pagesmith');
            $db->addValue('edit_permission', 'edit_page');
            if (PHPWS_Error::logIfError($db->update())) {
                $content[] = 'Unable to update phpws_key table.</pre>';
                return false;
            } else {
                $content[] = 'Updated phpws_key table.';
            }
            $content[] = '1.0.4 changes
------------------
+ Fixed pagesmith edit permission.
+ PageSmith home pages were missing edit link.</pre>';
        case version_compare($currentVersion, '1.0.5', '<'):
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('templates/page_templates/text_only/page.tpl'), $content);
            $content[] = '1.0.5 changes
----------------
+ Changed wording on move to front functionality
+ Added move to front to miniadmin
+ Fixed text_only template. Missing closing div tag.
</pre>';
        case version_compare($currentVersion, '1.0.6', '<'):
            $content[] = '<pre>
1.0.6 changes
-------------
+ Small fix to allow linkable images on cached pages.
</pre>';
        case version_compare($currentVersion, '1.0.7', '<'):
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('templates/settings.tpl'), $content);
            $content[] = '1.0.7 changes
-------------
+ PageSmith can be set to automatically create a link when a new page
  is created.
+ Changing a page title now updates the menu link.
</pre>';
        case version_compare($currentVersion, '1.1.0', '<'):
            PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');
            $content[] = '<pre>';
            Cabinet::convertImagesToFileAssoc('ps_block', 'type_id');
            $content[] = '--- Images converted for File Cabinet 2.0.0.';
            pagesmithUpdateFiles(array('javascript/passinfo/head.js', 'templates/page_templates/threesec/page.css', 'templates/page_templates/threesec/page.tpl', 'templates/page_templates/threesec/structure.xml', 'templates/page_templates/threesec/threesec.png'), $content);
            $content[] = '1.1.0 changes (unreleased)
-------------
+ PageSmith conforms to new File Cabinet update.
+ Added url parser to passinfo script to allow images to work with fck better.
</pre>';
        case version_compare($currentVersion, '1.2.1', '<'):
            $content[] = '<pre>';
            $source_tpl = PHPWS_SOURCE_DIR . 'mod/pagesmith/templates/page_templates/';
            $local_tpl = $home_dir . 'templates/pagesmith/page_templates/';
            $backup = $home_dir . 'templates/pagesmith/_page_templates/';
            $source_img = PHPWS_SOURCE_DIR . 'mod/pagesmith/img/folder_icons/';
            $local_img = $home_dir . 'images/mod/pagesmith/folder_icons/';
            if (is_dir($backup) || @PHPWS_File::copy_directory($local_tpl, $backup)) {
                $content[] = '--- Local page templates backed up to: ' . $backup;
            } else {
                $content[] = sprintf('--- Could not backup directory "%s" to "%s"</pre>', $local_tpl, $backup);
                return false;
            }
            if (PHPWS_File::copy_directory($source_tpl, $local_tpl)) {
                $content[] = '--- Local page templates updated.';
            } else {
                $content[] = sprintf('--- Could not copy directory "%s" to "%s"</pre>', $source_tpl, $local_tpl);
                return false;
            }
            if (PHPWS_File::copy_directory($source_img, $local_img)) {
                $content[] = '--- New page template icons copied locally.';
            } else {
                $content[] = sprintf('--- Could not copy directory "%s" to "%s"</pre>', $source_img, $local_img);
                return false;
            }
            if (!pagesmithSearchIndex()) {
                $content[] = '--- Unable to index pages in search. Check your error log.</pre>';
                return false;
            } else {
                $content[] = '--- Pages added to search';
            }
            $files = array('templates/pick_folder.tpl', 'templates/pick_template.tpl', 'templates/style.css', 'conf/folder_icons.php');
            pagesmithUpdateFiles($files, $content);
            $content[] = '1.2.1 changes
----------------
+ PageSmith now allows the sorting of templates
+ Page titles now added to search.
+ Wrong page ids don\'t 404. Send to message page.
+ Search indexing added to update and version raised.
+ Added search to pagesmith.
+ Changed to new url rewriting method.</pre>';
        case version_compare($currentVersion, '1.2.2', '<'):
            $content[] = '<pre>';
            $files = array('templates/page_list.tpl');
            pagesmithUpdateFiles($files, $content);
            $content[] = '
1.2.2 changes
---------------
+ Updated pagers to addSortHeaders.
+ Fixed direct access to page allowing view.
+ Front page does not alter page title.
+ Fixed some notices and a caching bug.
+ Changed wording on edit text windows.</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            $db = new PHPWS_DB('ps_block');
            $db->dropTableColumn('btype');
            $db = new PHPWS_DB('ps_page');
            if (PHPWS_Error::logIfError($db->addTableColumn('parent_page', 'int NOT NULL default 0'))) {
                $content[] = 'Could not create ps_page.parent_page column.';
                return false;
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('page_order', 'smallint NOT NULL default 0'))) {
                $content[] = 'Could not create ps_page.page_order column.';
                return false;
            }
            $db = new PHPWS_DB('ps_text');
            if (PHPWS_DB::getDBType() == 'mysql' || PHPWS_DB::getDBType() == 'mysqli') {
                if (PHPWS_Error::logIfError($db->alterColumnType('content', 'longtext NOT NULL'))) {
                    $content[] = 'Could not alter ps_text.content column.';
                }
            }
            $content[] = '<pre>';
            $files = array('javascript/passinfo/head.js', 'templates/page_form.tpl', 'javascript/delete_orphan/', 'javascript/confirm_delete/', 'javascript/update/head.js', 'templates/page_templates/threesec-tbl/', 'templates/orphans.tpl', 'templates/page_form.tpl', 'templates/page_frame.tpl', 'templates/page_list.tpl', 'templates/style.css', 'templates/sublist.tpl', 'templates/upload_template.tpl', 'img/add.png', 'img/delete.png', 'img/back.png', 'img/front.png');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_3_0.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.3.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/page_templates/threesec/page.tpl', 'templates/page_templates/threesec-tbl/page.tpl', 'templates/settings.tpl');
            pagesmithUpdateFiles($files, $content);
            $content[] = '1.3.1 changes
---------------
+ Page cache refreshed on page save.
+ Updated threesec templates to conform with norm box-title,
  box-content layout
+ Added ability to lengthen or shorten pagesmith links.
+ Added fix so edit mode does not parse smarttags.</pre>';
        case version_compare($currentVersion, '1.3.2', '<'):
            $content[] = '<pre>';
            Users_Permission::registerPermissions('pagesmith', $content);
            pagesmithUpdateFiles(array('templates/page_templates/'), $content);
            $content[] = '1.3.2 changes
----------------
+ Update was missing a permission update
+ Wrong permission getting called on settings
+ All page templates now have a class called pagesmith-page
+ Removed padding from page templates</pre>';
        case version_compare($currentVersion, '1.3.3', '<'):
            $db = new PHPWS_DB('ps_text');
            if (PHPWS_Error::logIfError($db->alterColumnType('content', 'longtext'))) {
                $content[] = 'Could not alter ps_text.content column.';
                return false;
            } else {
                $content[] = 'Updated ps_text.content column';
            }
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('javascript/disable_links/', 'javascript/update/head.js'), $content);
            $content[] = 'Version 1.3.3
--------------------------------------------------------------------
+ Made ps_text.content null instead of not null
+ Made a change in page editing. Text spaces receive text without
  formatting. Prior to this change the parseOutput was run before
  sending the data to the editor. This stripped data that may need
  editing.
  Now the text is sent to the editor without processing. After post
  the text IS processed. This fixed the filters. Anchors will be
  busted AFTER the edit post but I don\'t think they really need to
  work in edit mode.
+ Added javascript to prevent accidental link clicks in edit mode.
+ change_link was an id, changed to a class since there were several
  on a page.</pre>';
        case version_compare($currentVersion, '1.3.4', '<'):
            $content[] = '<pre>1.3.4 changes
-------------
+ Fixed link shortening
+ Restored missing placeholder width and height
+ Fixed lost text bug.
</pre>';
        case version_compare($currentVersion, '1.4.0', '<'):
            $content[] = '<pre>1.4.0 changes
-------------
+ Icon class implemented.
+ Fixed on disableLinks script.
+ Added black page check on saving. Prohibits empty content from being saved to the database.
+ Added option to turn off "Back to top" links.
+ Added default installation page.
+ PHP 5 strict fixes.</pre>';
        case version_compare($currentVersion, '1.4.1', '<'):
            $content[] = '<pre>1.4.1 changes
-------------
Fixed bug causing blank editors on edit.</pre>';
        case version_compare($currentVersion, '1.4.2', '<'):
            $content[] = '<pre>1.4.2 changes
-------------
+ Added conditionals to try and prevent blank page posting.
+ Updated javascript to jquery code.
+ Added some new templates.
.</pre>';
        case version_compare($currentVersion, '1.5.0', '<'):
            $content[] = '<pre>1.5.0 changes
---------------
+ New method of editing text. Click on text instead of edit image.
+ Javascript window replaced with Jquery dialog.
</pre>';
        case version_compare($currentVersion, '1.5.1', '<'):
            $content[] = '<pre>1.5.1 changes
---------------
+ Mouseover edit behavior changed.
+ Publish on date added.
</pre>';
        case version_compare($currentVersion, '1.5.2', '<'):
            $content[] = '<pre>1.5.2 changes
---------------
- Fixed error message
- Empty orphans are removed automatically.
- Dialog editor made modal.
</pre>';
        case version_compare($currentVersion, '1.5.3', '<'):
            $content[] = '<pre>1.5.3 changes
---------------
+ Edit hinting changed to Boostrap standard
+ Removed upload template tab and code
+ Font Awesome used in icons
+ Tweaked page listing.
+ Removed default background color from page template.
+ Fixed bug with pages saving untitled.
</pre>';
        case version_compare($currentVersion, '1.5.4', '<'):
            $content[] = '<pre>1.5.4 changes
---------------
+ Added titles to admin icons
+ Removed @ to prevent PHP warning message
+ Style changes to pager listing
+ Pop up width is relative to browser
</pre>';
        case version_compare($currentVersion, '1.6.0', '<'):
            $db = \Database::newDB();
            $table = $db->addTable('ps_page');
            $table->addFieldConditional('template', 'art');
            $table->addValue('template', 'banner');
            $db->update();
            $db->clearConditional();
            $table->reset();
            $c1 = $table->getFieldConditional('template', 'vtour');
            $c2 = $table->getFieldConditional('template', 'VTOUR');
            $db->addConditional($db->createConditional($c1, $c2, 'OR'));
            $table->addValue('template', 'threesec');
            $db->update();
            $content[] = '<pre>1.6.0 changes
---------------
+ Rewrote page templates to be Bootstrap compatible.
+ Removed art and vtour template.
</pre>';
        case version_compare($currentVersion, '1.6.1', '<'):
            $content[] = '<pre>1.6.1 changes
---------------
+ changed content editor pop up to use bootstrap modal instead of jquery dialog
+ Bootstrap styling to some UI elements
+ Back to top link pulled right with new icon
</pre>';
        case version_compare($currentVersion, '1.7.0', '<'):
            $content[] = <<<EOF
<pre>1.7.0 changes
------------------
+ Removed hardcoded h2 styles on some templates
+ Back to top default setting added
+ Clicking off edit window saves content
</pre>
EOF;
        case version_compare($currentVersion, '1.8.0', '<'):
            $db = \Database::newDB();
            $lb = $db->addTable('layout_box');
            $lb->addFieldConditional('module', 'pagesmith');
            $db->delete();
            $content[] = <<<EOF
<pre>1.8.0 changes
------------------
+ Removed all PageSmith pages from layout_box table. Was kept only for multiple front pages which no one used.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.0', '<'):
            $db = \Database::newDB();
            $pp = $db->addTable('ps_page');
            $st = $pp->addDataType('show_title', 'smallint');
            $st->add();
            $content[] = <<<EOF
<pre>1.9.0 changes
------------------
+ Added: Ability to hide title
+ Changed: Pagesmith editing works within Bootstrap modals.
+ Changed: Adapted to work with CKEditor 4.
+ Changed: Front page is now Highlander style.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.1', '<'):
            $db = \Database::newDB();
            $pp = $db->addTable('ps_page');
            if (!$pp->columnExists('hide_title') && $pp->columnExists('show_title')) {
                $dt = $pp->getDatatype('show_title');
                $dt->change('hide_title');
            }
            $content[] = <<<EOF
<pre>1.9.1 changes
------------------
+ Fixed: Code uses hide_title. Column name was show_title.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.2', '<'):
            $content[] = <<<EOF
<pre>1.9.2 changes
------------------
+ Fixed: hide_title was not properly formated in install.sql
+ Fixed: Reduced edit popup window height.
+ Feature: Added save button to CKEditor that works in maximize.
+ Feature: Added page update check to page submission.
+ Change: Save button is styled and larger.
+ Change: New page defaults to Text Only template.
</pre>
EOF;
        case version_compare($currentVersion, '1.10.0', '<'):
            $db = \Database::newDB();
            $t1 = $db->addTable('ps_page');
            $dt = $t1->addDatatype('deleted', 'smallint');
            $dt->setDefault(0);
            $dt->add();
            $content[] = <<<EOF
<pre>
1.10.0 Changes
---------------
+ Deleted pages are kept in database
</pre>
EOF;
    }
    // end switch
    return true;
}
Пример #7
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;
}
Пример #8
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function users_update(&$content, $currentVersion)
{
    $home_dir = PHPWS_Boost::getHomeDir();
    switch ($currentVersion) {
        case version_compare($currentVersion, '2.2.0', '<'):
            $content[] = 'This package does not update versions under 2.2.0';
            return false;
        case version_compare($currentVersion, '2.2.1', '<'):
            $content[] = '+ Fixed a bug causing conflicts between user and group permissions.';
        case version_compare($currentVersion, '2.2.2', '<'):
            $content[] = '+ Set username to the same character size in both users table and user_authorization.';
            $content[] = '+ Fixed typo causing branch installation failure on Postgresql.';
        case version_compare($currentVersion, '2.3.0', '<'):
            $content[] = '<pre>
2.3.0 changes
------------------------
+ Added translate function calls in classes and my_page.php
+ my_page hides translation option if language defines disable selection
+ Added a unrestricted only parameter to Current_User\'s allow and
  authorize functions
+ Dropped references from some constructors
+ Added error check to setPermissions function: won\'t accept empty
  group id
+ Changed id default to zero.
+ Removed unneeded function parameter on getGroups
</pre>
';
        case version_compare($currentVersion, '2.3.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/my_page/user_setting.tpl');
            userUpdateFiles($files, $content);
            $content[] = '
2.3.1 changes
------------------------
+ Added ability for user to set editor preferences
</pre>
';
        case version_compare($currentVersion, '2.3.2', '<'):
            $content[] = '<pre>2.3.2 changes';
            $files = array('img/users.png', 'templates/user_main.tpl');
            userUpdateFiles($files, $content);
            $content[] = '+ Added error check to login.
+ Changed user control panel icon.
+ Fixed template typo that broke IE login.
+ Removed fake French translation (delete mod/users/locale/fr_FR/ directory
+ Permissions are now ordered alphabetically.
+ isUser will now always return false if passed a zero id.
+ Added new function requireLogin that forwards a user to the login
  screen
</pre>';
        case version_compare($currentVersion, '2.4.0', '<'):
            if (!PHPWS_DB::isTable('users_pw_reset')) {
                $new_table = 'CREATE TABLE users_pw_reset (
user_id INT NOT NULL default 0,
authhash CHAR( 32 ) NOT NULL default 0,
timeout INT NOT NULL default 0,
);';
                if (!PHPWS_DB::import($new_table)) {
                    $content[] = 'Unable to create users_pw_reset table.';
                    return false;
                } else {
                    $content[] = 'Created new table: users_pw_reset';
                }
            }
            $files = array('templates/forms/reset_password.tpl', 'templates/forms/forgot.tpl', 'conf/config.php', 'templates/usermenus/top.tpl', 'templates/forms/settings.tpl', 'templates/my_page/user_setting.tpl');
            $content[] = '<pre>';
            userUpdatefiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/users/boost/changes/2_4_0.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.1', '<'):
            $content[] = '<pre>';
            $files = array('conf/languages.php');
            userUpdateFiles($files, $content);
            $content[] = '
2.4.1 changes
------------------------
+ Default item id on permission check functions is now zero instead of
  null. This will make checking permissions a little easier on new items.
+ Bug #1690657 - Changed group select js property to onclick instead
  of onchange. Thanks singletrack.
+ Changed the language abbreviation for Danish
</pre>
';
        case version_compare($currentVersion, '2.4.2', '<'):
            $content[] = '<pre>';
            $files = array('templates/usermenus/Default.tpl');
            userUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/users/boost/changes/2_4_2.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.3', '<'):
            $content[] = '<pre>';
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/users/boost/changes/2_4_3.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.4', '<'):
            $content[] = '<pre>';
            $source_dir = PHPWS_SOURCE_DIR . 'mod/users/javascript/';
            $dest_dir = $home_dir . 'javascript/modules/users/';
            if (PHPWS_File::copy_directory($source_dir, $dest_dir, true)) {
                $content[] = "--- Successfully copied {$source_dir} to {$dest_dir}";
            } else {
                $content[] = "--- Could not copy {$source_dir} to {$dest_dir}";
            }
            $files = array('conf/error.php', 'templates/forms/permissions.tpl', 'templates/forms/permission_pop.tpl');
            userUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/users/boost/changes/2_4_4.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.5', '<'):
            $content[] = '<pre>';
            $files = array('conf/error.php', 'conf/languages.php', 'templates/forms/settings.tpl', 'templates/manager/groups.tpl');
            userUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/users/boost/changes/2_4_5.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.6', '<'):
            $content[] = '<pre>';
            $files = array('templates/forms/forgot.tpl');
            userUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = '
2.4.6 changes
-------------------
+ Added error check to permission menu.
+ Error for missing user groups now reports user id.
+ Forgot password will work if CAPTCHA is disabled.
+ Using new savePermissions function instead of save.
+ Current_User was calling giveItemPermissions incorrectly.';
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.7', '<'):
            $content[] = '<pre>
2.4.7 changes
-------------------
+ Removed global authorization from change password check since it is not
  written yet.
</pre>';
        case version_compare($currentVersion, '2.4.9', '<'):
            $content[] = '<pre>';
            if (PHPWS_Core::isBranch() || PHPWS_Boost::inBranch()) {
                $user_db = new PHPWS_DB('users');
                $user_db->addWhere('deity', 1);
                $user_db->addColumn('id');
                $user_db->addColumn('username');
                $user_db->setIndexBy('id');
                $user_ids = $user_db->select('col');
                if (!empty($user_ids) && !PHPWS_Error::logIfError($user_ids)) {
                    $group_db = new PHPWS_DB('users_groups');
                    foreach ($user_ids as $id => $username) {
                        $group_db->addWhere('user_id', $id);
                        $result = $group_db->select('row');
                        if (!$result) {
                            $group_db->reset();
                            $group_db->addValue('active', 1);
                            $group_db->addValue('name', $username);
                            $group_db->addValue('user_id', $id);
                            if (!PHPWS_Error::logIfError($group_db->insert())) {
                                $content[] = '--- Created missing group for user: '******'2.4.9 changes
-----------------
+ Raised sql character limit in default username, display_name, and
  group name installs.
+ Fixed bug with forbidden usernames
+ Added a function to group to remove its permissions upon deletion.
+ Bookmark won\'t return a user to a authkey page if their session dies.
+ Fixed bug #1850815 : unknown function itemIsAllowed in Permission.php
+ My Pages are unregistered on module removal.
+ My Page tab stays fixed.
</pre>';
        case version_compare($currentVersion, '2.5.0', '<'):
            $content[] = '<pre>';
            $files = array('templates/forms/memberlist.tpl', 'templates/forms/userForm.tpl', 'javascript/generate/head.js', 'templates/manager/groups.tpl', 'templates/manager/users.tpl');
            userUpdateFiles($files, $content);
            $content[] = '2.5.0 changes
-------------------
+ Members\' names alphabetized
+ New user email notification added.
+ Fixed member listing  dropping names past 10.
+ Added random password generator on user edit form.
+ Removed reference from Action.php causing php notice.
+ Changed redundant static method call in Permission.
+ Added dash to allowed display name characters.
+ Added \\pL to display name characters.
+ Users will now query modules should a user get deleted.
+ Added an error check to Permissions.
+ Users will now look for remove_user.php in all modules\' inc/
  directory in order to run the remove_user function.
+ Using pager\'s addSortHeaders in user and group listing
+ Added display name to pager search.
</pre>';
        case version_compare($currentVersion, '2.6.0', '<'):
            $content[] = '<pre>';
            Users_Permission::registerPermissions('users', $content);
            $db = new PHPWS_DB('users_auth_scripts');
            $db->addWhere('filename', 'local.php');
            $db->addColumn('id');
            $auth_id = $db->select('one');
            PHPWS_Settings::set('users', 'local_script', $auth_id);
            PHPWS_Settings::save('users');
            $files = array('conf/languages.php', 'templates/my_page/user_setting.tpl', 'templates/usermenus/css.tpl', 'img/permission.png', 'templates/forms/userForm.tpl');
            userUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/users/boost/changes/2_6_0.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.6.1', '<'):
            $content[] = '<pre>2.6.1 changes
------------------
+ requireLogin now reroutes dependant on the user authorization
+ If the user\'s group is missing when they are updated, a new one is
  properly created. Prior to the fix, a new group was created without an
  assigned user id.
+ Added error message to my page if update goes bad.
</pre>';
        case version_compare($currentVersion, '2.6.2', '<'):
            $content[] = '<pre>';
            $files = array('templates/forms/settings.tpl');
            userUpdateFiles($files, $content);
            $content[] = '2.6.2 changes
------------------
+ Moved error file to inc/
+ Blank passwords forbidden.
+ Error check added to cosign authorization.
+ php fiveasized the classes.
+ Added some needed error logging to user creation problems
+ Added ability for default user groups to be set for admin created
  and newly joined users.
+ Fixed testing on addMembers. Previous code was nonsensical.
+ _user_group id gets set upon a user object save.
</pre>';
        case version_compare($currentVersion, '2.6.3', '<'):
            $content[] = '<pre>';
            $files = array('img/deity.gif', 'img/delete.png', 'img/edit.png', 'img/man.gif', 'img/key.png', 'img/members.png', 'templates/forms/authorization.tpl', 'templates/forms/settings.tpl', 'templates/manager/users.tpl');
            userUpdateFiles($files, $content);
            $db = new PHPWS_DB('users_auth_scripts');
            PHPWS_Error::logIfError($db->addTableColumn('default_group', 'int not null default 0'));
            $content[] = '2.6.3 changes
------------------
+ Added icons for admin options under manage users and groups
+ Disabled active link in groups listing
+ Authorization scripts now have default group assignments. New
  members will assigned to a group based on their authorization
  method.
+ Removed default group by user or admin from settings.
+ Added ability to view users by whether or not they are in a
  particular group.
+ Added pager caching to group listing
+ Display name may now not be the same as another user\'s username
+ Extended user name error to include display name
+ Added empty password check to ldap script
</pre>';
        case version_compare($currentVersion, '2.6.4', '<'):
            $db = new PHPWS_DB('users_auth_scripts');
            PHPWS_Error::logIfError($db->addTableColumn('default_group', 'int not null default 0'));
            $content[] = '<pre>2.6.4 changes
-------------------------
+ Added missing column to install.sql</pre>';
        case version_compare($currentVersion, '2.6.5', '<'):
            $content[] = '<pre>';
            userUpdateFiles(array('conf/languages.php'), $content);
            $content[] = '2.6.5 changes
-------------------------
+ Added missing column to install.sql</pre>';
        case version_compare($currentVersion, '2.6.6', '<'):
            $content[] = '<pre>';
            userUpdateFiles(array('templates/forms/userForm.tpl'), $content);
            $content[] = '2.6.6 changes
        -----------------------
+ Graceful recovery from broken authentication scripts.
+ Authorization script made deity only
+ Fixed default groups on external authentication
+ Deleted auth scripts will update users under it to use local instead.
+ The user constructor was trying to load the authorization script on
  failed users. Thanks Verdon.</pre>';
        case version_compare($currentVersion, '2.7.0', '<'):
            $content[] = '<pre>2.7.0 changes
-------------------------
+ Usernames and passwords can not be changed on non local users
+ Added switch to settings to prevent admins from making new users
+ Site admin can be set by non-deities again
+ Fixed bug with users able to change password on alternate auth.
+ Fixed some bugs with user creation and editing with alternate authentication.
+ Hiding permissions and members in create group form
+ Icon class implemented.
+ Strict PHP 5 changes made.
</pre>';
        case version_compare($currentVersion, '2.7.1', '<'):
            $content[] = '<pre>2.7.1 changes
-------------------------
+ Improved cosign script
+ Fixed errors getting dropped without logging.
</pre>';
        case version_compare($currentVersion, '2.7.2', '<'):
            $content[] = '<pre>2.7.2 changes
-------------------------
+ Fixed multiple group member bug.
+ Cleaned up cosign authentication.
+ Current_User requireLogin to use login_link instead of login_url
+ New User form now properly respects the "settings" permission for showing
  user authentication script option.
+ User constuction allow username parameter.
+ Trim whitespace from user email addresses. Don\'t modify the member variable
  unless all the sanity checks passed.
</pre>';
        case version_compare($currentVersion, '2.7.3', '<'):
            PHPWS_Core::initModClass('users', 'Action.php');
            User_Action::checkPermissionTables();
            $content[] = '<pre>2.7.3 changes
------------------------
+ Update permissions
</pre>';
        case version_compare($currentVersion, '2.7.4', '<'):
            $content[] = '<pre>2.7.4 changes
------------------------
+ Fixed 500 error on My Page
</pre>';
        case version_compare($currentVersion, '2.7.5', '<'):
            $content[] = '<pre>2.7.5 changes
------------------------
+ Loosened group name restrictions
+ User edit page shows group membership
</pre>';
        case version_compare($currentVersion, '2.7.6', '<'):
            $content[] = '<pre>2.7.6 changes
------------------------
+ Updated icons to Font Awesome
+ Email addresses may now be used as user names.
+ Static method call fixed.
+ Added exception error for missing authorization file.
+ My Page no longer is using tabs as other modules use of My Page have been removed.
+ css.tpl template rewritten. Login now works closer with authentication script.
    - drop down no longer contains Home or Control Panel. Account link added - takes
        user to their account page to change their password.
</pre>';
        case version_compare($currentVersion, '2.8.0', '<'):
            $content[] = <<<EOF
<pre>2.8.0 changes
-----------------
+ Added suggested bootstrap classes from TRF
+ Removed call to nonexistent method.
+ Moved icons to left and set admin-icons class to column.
+ Added FA icon here for mini admin
+ Changed to ensure users_auth_scripts table was created properly
+ Session timeouts are now tracked. Warning to user given before failure.
</pre>
EOF;
        case version_compare($currentVersion, '2.8.1', '<'):
            \PHPWS_Settings::set('users', 'session_warning', 0);
            \PHPWS_Settings::save('users');
            $content[] = <<<EOF
<pre>2.8.1 changes
-----------------
+ Changing default on user session to false. If you want it enabled, do so in settings.
</pre>
EOF;
        case version_compare($currentVersion, '2.8.2', '<'):
            $content[] = <<<EOF
<pre>2.8.2 changes
-----------------
+ Bug Fix: Unstyled permission pop up.
</pre>
EOF;
    }
    // End of switch statement
    return TRUE;
}
Пример #9
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;
}
Пример #10
0
 public function registerPermissions($module, &$content)
 {
     return Users_Permission::registerPermissions($module, $content);
 }
Пример #11
0
 public function dropPermissions()
 {
     $modules = PHPWS_Core::getModules(true, true);
     if (empty($modules)) {
         return false;
     }
     foreach ($modules as $mod) {
         $permTable = Users_Permission::getPermissionTableName($mod);
         $db = new PHPWS_DB($permTable);
         if (!$db->isTable($permTable)) {
             continue;
         }
         $db->addWhere('group_id', $this->id);
         PHPWS_Error::logIfError($db->delete());
         $db = new PHPWS_DB('phpws_key_edit');
         $db->addWhere('group_id', $this->id);
         PHPWS_Error::logIfError($db->delete());
         $db = new PHPWS_DB('phpws_key_view');
         $db->addWhere('group_id', $this->id);
         PHPWS_Error::logIfError($db->delete());
     }
     return true;
 }
Пример #12
0
 public static function checkPermissionTables()
 {
     PHPWS_Core::initModClass('users', 'Permission.php');
     $db = new PHPWS_DB('modules');
     $db->addWhere('active', 1);
     $db->addColumn('title');
     $result = $db->select('col');
     foreach ($result as $mod_title) {
         $content[] = '<br />';
         $content[] = sprintf(dgettext('users', 'Checking %s module'), $mod_title);
         $result = Users_Permission::registerPermissions($mod_title, $content);
         if (!$result) {
             $content[] = dgettext('users', 'No permissions file found.');
             continue;
         }
     }
     return implode('<br>', $content);
 }
Пример #13
0
 /**
  * Returns an associative list of all groups and their levels of permission
  * in reference to the key passed to it
  */
 public static function getPermissionGroups($key, $edit_rights = false)
 {
     if (empty($key) || !is_a($key, 'Key') || $key->isHomeKey() || empty($key->module) || $edit_rights && empty($key->edit_permission)) {
         return NULL;
     }
     $permTable = Users_Permission::getPermissionTableName($key->module);
     if (!PHPWS_DB::isTable($permTable)) {
         return PHPWS_Error::get(USER_ERR_PERM_FILE, 'users', __CLASS__ . '::' . __FUNCTION__);
     }
     $db = new PHPWS_DB('users_groups');
     $db->addColumn('users_groups.*');
     $db->addColumn("{$permTable}.permission_level");
     $db->addWhere('id', "{$permTable}.group_id");
     $db->addWhere("{$permTable}.permission_level", 0, '>');
     $test_db = new PHPWS_DB($permTable);
     if ($edit_rights) {
         if (!$test_db->isTableColumn($key->edit_permission)) {
             return PHPWS_Error::get(KEY_PERM_COLUMN_MISSING, 'core', 'Users_Permission::getRestrictedGroups', $key->edit_permission);
         }
         $db->addWhere($permTable . '.' . $key->edit_permission, 1);
     }
     $db->addOrder('name');
     $result = $db->select();
     if (empty($result) || PHPWS_Error::isError($result)) {
         return $result;
     }
     foreach ($result as $group) {
         if ($group['user_id']) {
             if ($group['permission_level'] == RESTRICTED_PERMISSION) {
                 $glist['restricted']['all'][] = $glist['restricted']['users'][] = $group;
             } else {
                 $glist['unrestricted']['users'][] = $glist['unrestricted']['all'][] = $group;
             }
             $glist['permitted']['users'][] = $group;
         } else {
             if ($group['permission_level'] == RESTRICTED_PERMISSION) {
                 $glist['restricted']['groups'][] = $glist['restricted']['all'][] = $group;
             } else {
                 $glist['unrestricted']['groups'][] = $glist['unrestricted']['all'][] = $group;
             }
             $glist['permitted']['groups'][] = $group;
         }
         $glist['permitted']['all'][] = $group;
     }
     return $glist;
 }
Пример #14
0
 public static function giveItemPermission($key)
 {
     $result = Users_Permission::giveItemPermission(Current_User::getId(), $key);
     $_SESSION['User']->loadUserGroups();
     $_SESSION['User']->loadPermissions();
 }