Zap all trailing whitespace.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 11 Apr 2020 05:28:50 +0000 (01:28 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 11 Apr 2020 05:28:50 +0000 (01:28 -0400)
    find . -name '*.php' -exec gsed -i -E 's/\s+$//' {} \+ ;

107 files changed:
admin/automation.php
admin/field.php
admin/global.php
admin/language.php
admin/permission.php
admin/priority.php
admin/product.php
admin/purge_inactive.php
admin/resolution.php
admin/setting.php
admin/severity.php
admin/status.php
admin/user.php
admin/usergroup.php
admin/userhelp.php
attachment.php
docs/datatools.php
docs/datatools_store.php
docs/mailtest.php
docs/migrate_custom_fields.php
docs/mycookies.php
docs/populate.php
docs/post-commit.php
docs/update_bug_table_cache.php
docs/update_field_order_in_bugs.php
editcomment.php
editreport.php
explain.php
favorite.php
framework/api.php
framework/date.php
framework/dev/conditionaltest.php
framework/functions.php
framework/graph_pie.php
framework/installer.php
framework/kernel.php
framework/mail.php
framework/pagination.php
framework/printer.css.php
framework/printer.php
framework/printer_css.php
framework/printer_navigation.php
framework/template.php
framework/template_fs.php
framework/xml.php
global.php
includes/api_attachment.php
includes/api_automation.php
includes/api_bug.php
includes/api_comment.php
includes/api_field.php
includes/api_language.php
includes/api_priority.php
includes/api_resolution.php
includes/api_severity.php
includes/api_status.php
includes/api_user.php
includes/api_usergroup.php
includes/api_userhelp.php
includes/auth/auth.php
includes/auth/auth_default.php
includes/auth/auth_drupal.php
includes/auth/auth_ipb2.php
includes/auth/auth_phpbb2.php
includes/auth/auth_vbulletin.php
includes/class_admin_navigation.php
includes/class_api_error.php
includes/class_logging.php
includes/class_message_reporter.php
includes/class_mo.php
includes/class_notification.php
includes/class_sort.php
includes/functions.php
includes/functions_datastore.php
includes/functions_product.php
includes/language.php
index.php
install/convert_database_charset.php
install/install.php
install/upgrade.php
install/upgrade1.php
install/upgrade10.php
install/upgrade11.php
install/upgrade12.php
install/upgrade13.php
install/upgrade14.php
install/upgrade15.php
install/upgrade16.php
install/upgrade17.php
install/upgrade18.php
install/upgrade19.php
install/upgrade2.php
install/upgrade3.php
install/upgrade4.php
install/upgrade5.php
install/upgrade6.php
install/upgrade7.php
install/upgrade8.php
install/upgrade9.php
login.php
newreport.php
register.php
search.php
showreport.php
syndicate.php
userctrl.php
vote.php

index 491a74c460406b9e89d3ced7640543189d2e2417..5e122263f0dd75822c2c092f15055aab473f5b0a 100644 (file)
@@ -48,7 +48,7 @@ if ($_REQUEST['do'] == 'kill')
        $action->set('actionid',        $bugsys->in['actionid']);
        $action->set_condition();
        $action->delete();
-       
+
        $admin->redirect('automation.php?do=modify');
 }
 
@@ -64,7 +64,7 @@ if ($_REQUEST['do'] == 'delete')
 if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update')
 {
        $deltas = array('builtin' => array(), 'custom' => array());
-       
+
        if (is_array($bugsys->in['fields']))
        {
                foreach ($bugsys->in['fields'] AS $key => $value)
@@ -75,7 +75,7 @@ if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update')
                        }
                }
        }
-       
+
        if (is_array($bugsys->in['fields']['custom']))
        {
                foreach ($bugsys->in['fields']['custom'] AS $key => $value)
@@ -86,17 +86,17 @@ if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update')
                        }
                }
        }
-       
+
        $action = new AutomationAPI($bugsys);
        $action->set('name',                    $bugsys->in['name']);
        $action->set('description',             $bugsys->in['description']);
        $action->set('fieldchanges',    $deltas);
        $action->set('comment',                 $bugsys->in['comment']);
-       
+
        if ($_POST['do'] == 'insert')
        {
                $action->insert();
-               
+
                $admin->redirect('automation.php');
        }
        else
@@ -104,7 +104,7 @@ if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update')
                $action->set('actionid',        $bugsys->in['actionid']);
                $action->set_condition();
                $action->update();
-               
+
                $admin->redirect('automation.php');
        }
 }
@@ -115,12 +115,12 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
 {
        $add = ($_REQUEST['do'] == 'add');
        $edit = !$add;
-       
+
        if ($edit)
        {
                NavLinks::automationsEdit($bugsys->in['actionid']);
                $navigator->set_focus('link', 'fields-pages-automations', 'fields-pages');
-       
+
                $action = new AutomationAPI($bugsys);
                $action->set('actionid',        $bugsys->in['actionid']);
                $action->set_condition();
@@ -134,39 +134,39 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        }
 
        $admin->page_start(($add ? T('New Automation') : T('Edit Automation')));
-       
+
        $admin->form_start('automation.php', ($add ? 'insert' : 'update'));
-       
+
        if ($edit)
        {
                $admin->form_hidden_field('actionid', $action->objdata['actionid']);
        }
-       
+
        $admin->table_start();
        $admin->table_head(($add ? T('New Automation') : T('Edit Automation')));
-       
+
        $admin->row_input(T('Name'), 'name', $action->objdata['name']);
        $admin->row_textarea(T('Description'), 'description', $action->objdata['description']);
        $admin->row_textarea(T('Add Comment'), 'comment', $action->objdata['comment']);
-       
+
        $admin->row_span(T('Field Changes'), 'thead', 'center');
-               
+
        // -------------------------------------------------------------------
-       // built-in fields      
+       // built-in fields
        construct_datastore_select('severity', 'severity', 'severityid', $action->objdata['fields']['builtin']['severity'], true, true);
        $admin->row_list(T('Severity'), 'fields[severity]');
-       
+
        construct_datastore_select('priority', 'priority', 'priorityid', $action->objdata['fields']['builtin']['priority'], true, true);
        $admin->row_list(T('Priority'), 'fields[priority]');
-       
+
        construct_datastore_select('status', 'status', 'statusid', $action->objdata['fields']['builtin']['status'], true, true);
        $admin->row_list(T('Status'), 'fields[status]');
-       
+
        construct_datastore_select('resolution', 'resolution', 'resolutionid', $action->objdata['fields']['builtin']['resolution'], true, true);
        $admin->row_list(T('Resolution'), 'fields[resolution]');
-       
+
        $admin->row_span('', 'tcat', 'center');
-       
+
        // -------------------------------------------------------------------
        // custom fields
        $fields_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid ASC");
@@ -177,19 +177,19 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                        case 'input_text':
                                $admin->row_input($field['name'], "fields[custom][$field[fieldid]]", $action->objdata['fields']['custom']["$field[fieldid]"]);
                        break;
-                       
+
                        case 'input_checkbox':
                                $admin->list_item('', -1, (!$action->objdata['fields']['custom']["$field[fieldid]"] OR $action->objdata['fields']['custom']["$field[fieldid]"] == -1));
                                $admin->list_item(T('Checked'), 1, ($action->objdata['fields']['custom']["$field[fieldid]"] == 1));
                                $admin->list_item(T('Un-Checked'), 0, (isset($action->objdata['fields']['custom']["$field[fieldid]"]) AND $action->objdata['fields']['custom']["$field[fieldid]"] == 0));
                                $admin->row_list($field['name'], "fields[custom][$field[fieldid]]");
                        break;
-                       
+
                        case 'select_single':
                                $selectopts = unserialize($field['selects']);
-                               
+
                                $admin->list_item('', -1, (!isset($action->objdata['fields']['custom']["$field[fieldid]"]) OR $action->objdata['fields']['custom']["$field[fieldid]"] == -1));
-                               
+
                                foreach ($selectopts AS $id => $select)
                                {
                                        $admin->list_item(stripslashes($select), $id, (isset($action->objdata['fields']['custom']["$field[fieldid]"]) AND $action->objdata['fields']['custom']["$field[fieldid]"] == $id));
@@ -199,11 +199,11 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                }
        }
        unset($select);
-       
+
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -213,20 +213,20 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::automationsAdd();
        $navigator->set_focus('link', 'fields-pages-automations', 'fields-pages');
-       
+
        $admin->page_start(T('Automations'));
-       
+
        $admin->table_start();
        $admin->table_head(T('Automations'));
-       
+
        $actions = $db->query("SELECT * FROM " . TABLE_PREFIX . "automation ORDER BY name ASC");
        while ($action = $db->fetch_array($actions))
        {
                $admin->row_text($action['name'] . "\n<div class=\"smallfont\">$action[description]</div>", "<a href=\"automation.php?do=edit&amp;actionid=$action[actionid]\">[" . T('Edit') . "]</a> <a href=\"automation.php?do=delete&amp;actionid=$action[actionid]\">[" . T('Delete') . "]</a>");
        }
-       
+
        $admin->table_end();
-       
+
        $admin->page_end();
 }
 
index 0512bd9516ea3c0317afd79013a3af2e13dfb19f..f151bb197c793cd85e703a3daf9cba751880c88a 100644 (file)
@@ -48,14 +48,14 @@ if ($_REQUEST['do'] == 'kill')
        $field->set('fieldid',          $bugsys->in['fieldid']);
        $field->set_condition();
        $field->delete();
-       
+
        $admin->redirect('field.php?do=modify');
 }
 
 // ###################################################################
 
 if ($_REQUEST['do'] == 'delete')
-{      
+{
        $admin->page_confirm(T('Are you sure you want to delete this bug field? Doing so will remove everything for this field and it cannot be undone!'), 'field.php', 'kill', array('fieldid' => $bugsys->in['fieldid']));
 }
 
@@ -65,17 +65,17 @@ if ($_REQUEST['do'] == 'update')
 {
        $edit = false;
        $add = true;
-       
+
        $type = $bugsys->in['type'];
-       
+
        $field = new FieldAPI($bugsys);
-       
+
        if ($bugsys->in['fieldid'])
        {
                $field->set('fieldid',          $bugsys->in['fieldid']);
                $field->set_condition();
                $field->fetch();
-               
+
                $edit = true;
                $add = false;
                $type = $field->objdata['type'];
@@ -84,7 +84,7 @@ if ($_REQUEST['do'] == 'update')
        {
                $field->set('type',             $type);
        }
-       
+
        switch ($type)
        {
                case 'input_text':
@@ -92,27 +92,27 @@ if ($_REQUEST['do'] == 'update')
                        $field->set('regexmatch',       $bugsys->in['regexmatch']);
                        $field->set('maxlength',        $bugsys->in['maxlength']);
                break;
-               
+
                case 'input_checkbox':
                        $field->set('defaultvalue',     $bugsys->in['defaultvalue']);
                break;
-               
+
                case 'select_single':
                        $field->set('selects',          $bugsys->in['selects']);
                        $field->set('usedefault',       $bugsys->in['usedefault']);
                break;
        }
-       
+
        $field->set('name',                     $bugsys->in['name']);
        $field->set('description',      $bugsys->in['description']);
        $field->set('required',         $bugsys->in['required']);
        $field->set('cansearch',        $bugsys->in['cansearch']);
-       
+
        if ($add)
        {
                $field->insert();
                $fieldid = $field->insertid;
-               
+
                $db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD custom$fieldid MEDIUMTEXT NULL");
                $db->query("OPTIMIZE TABLE " . TABLE_PREFIX . "bug");
        }
@@ -121,20 +121,20 @@ if ($_REQUEST['do'] == 'update')
                $field->update();
                $fieldid = $field->values['fieldid'];
        }
-       
+
        $bugsys->input_clean('custom', TYPE_UINT);
        foreach ($bugsys->in['custom'] AS $usergroupid => $mask)
        {
                $values[] = $bugsys->clean($usergroupid, TYPE_UINT) . ", $fieldid, " . $mask;
        }
-       
+
        $db->query("
                REPLACE INTO " . TABLE_PREFIX . "bugfieldpermission
                        (usergroupid, fieldid, mask)
                VALUES
                        (" . implode("),\n\t\t\t(", $values) . ")"
        );
-       
+
        $admin->redirect('field.php?do=modify', ($add ? T('The custom field has been added') : T('The custom field has been updated')));
 }
 
@@ -143,11 +143,11 @@ if ($_REQUEST['do'] == 'update')
 if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
 {
        $field = new FieldAPI($bugsys);
-       
+
        $add = (($_REQUEST['do'] == 'add') ? true : false);
        $typeselect = (($add AND empty($bugsys->in['step'])) ? true : false);
        $edit = (($add) ? false : true);
-       
+
        if ($add)
        {
                NavLinks::fieldsAdd();
@@ -158,7 +158,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                NavLinks::fieldsEdit($bugsys->in['fieldid']);
                $navigator->set_focus('link', 'fields-pages-fields', 'fields-pages');
        }
-       
+
        $admin->page_start(($add ? T('Add New Custom Field') : T('Edit Custom Field')));
        $admin->form_start('field.php', ($typeselect ? 'add' : 'update'));
        if ($add AND !$typeselect)
@@ -176,21 +176,21 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                $admin->table_start();
                $admin->table_head(($add ? T('Add New Bug Field') . ' - ' . FieldAPI::field_types($bugsys->in['type']) : T('Edit Field')));
        }
-       
+
        if ($edit)
        {
                $field->set('fieldid',          $bugsys->in['fieldid']);
                $field->set_condition();
                $field->fetch();
-               
+
                $admin->form_hidden_field('fieldid', $field->objdata['fieldid']);
        }
-       
+
        if (!$typeselect)
        {
                $type = (($add) ? $bugsys->in['type'] : $field->objdata['type']);
        }
-       
+
        // show type selector
        if (empty($bugsys->in['step']) AND $add)
        {
@@ -199,7 +199,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                        $admin->list_item($description, $name);
                }
                $admin->row_list(T('Field Type'), 'type', false);
-               
+
                $admin->row_submit();
                $admin->table_end();
        }
@@ -207,7 +207,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        else
        {
                $field->set('type',             $type);
-               
+
                // global fields
                $admin->row_span(T('Global Fields'), 'thead', 'center');
                $admin->row_text(T('Field Type'), FieldAPI::field_types($type));
@@ -215,10 +215,10 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                $admin->row_textarea(T('Description'), 'description', $field->objdata['description']);
                $admin->row_yesno(T('Required'), 'required', $field->objdata['required']);
                $admin->row_yesno(T('Can Be Searched'), 'cansearch', ((isset($field->objdata['cansearch'])) ? $field->objdata['cansearch'] : true));
-               
+
                // type-specific fields
                $admin->row_span(T('Type-Specific Fields'), 'thead', 'center');
-               
+
                switch ($type)
                {
                        case 'input_text':
@@ -226,23 +226,23 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                                $admin->row_input(T('Regular Expression Match'), 'regexmatch', $field->objdata['regexmatch']);
                                $admin->row_input(T('Maximum Length'), 'maxlength', $field->objdata['maxlength'], 2, 10);
                        break;
-                       
+
                        case 'input_checkbox':
                                $admin->row_yesno(T('Checked By Default'), 'defaultvalue', $field->objdata['defaultvalue']);
                        break;
-                       
+
                        case 'select_single':
                                $admin->row_textarea(T('Selection Values'), 'selects', stripslashes(implode("\n", (array)unserialize($field->objdata['selects']))));
                                $admin->row_yesno(T('Make the First Option Default'), 'usedefault', $field->objdata['usedefault']);
                        break;
                }
-               
+
                $admin->table_end();
-               
+
                // custom field permissions
                $admin->table_start();
                $admin->table_head(T('Custom Field Permissions'));
-               
+
                if ($edit)
                {
                        $perms = $db->query("SELECT usergroupid, mask FROM " . TABLE_PREFIX . "bugfieldpermission WHERE fieldid = " . $field->objdata['fieldid']);
@@ -251,7 +251,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                                $permissions["$perm[usergroupid]"] = $perm['mask'];
                        }
                }
-               
+
                $usergroups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid");
                while ($usergroup = $db->fetch_array($usergroups))
                {
@@ -261,16 +261,16 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                        $admin->list_item(T('Can View, Edit Field'), 2, $permissions["$usergroup[usergroupid]"] == 2);
                        $admin->row_list($usergroup['title'], "custom[$usergroup[usergroupid]]");
                }
-               
+
                $admin->table_end();
-               
+
                // end table
                $admin->table_start();
                $admin->row_submit();
                $admin->table_end();
                $admin->form_end();
        }
-       
+
        $admin->page_end();
 }
 
@@ -280,13 +280,13 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::fieldsAdd();
        $navigator->set_focus('link', 'fields-pages-fields', 'fields-pages');
-       
+
        $admin->page_start(T('Additional Bug Fields'));
-       
+
        $admin->table_start();
        $admin->table_head(T('Additional Bug Fields'), 3, 'custom_bug_fields');
        $admin->table_column_head(array(T('Display Name/Description'), T('Field ID'), T('Actions')));
-       
+
        $fields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid ASC");
        while ($field = $db->fetch_array($fields))
        {
@@ -298,9 +298,9 @@ if ($_REQUEST['do'] == 'modify')
                        )
                );
        }
-       
+
        $admin->table_end();
-       
+
        $admin->page_end();
 }
 
index b49f19b7a214fe4a6a7d68d61834b2354b36e041..409c22844ad764f24994af5c1a4fe90e960ce8d1 100644 (file)
@@ -51,11 +51,11 @@ $admin->css_link('../framework/printer.css.php');
 function admin_login()
 {
        global $admin, $bugsys;
-       
+
        define('ISSO_PRINTER_NO_NAVIGATION', 1);
-       
+
        $admin->page_start(T('Login'), null, '', 'document.cplogin.' . ($bugsys->userinfo['email'] ? 'password' : 'email') . '.focus();');
-       
+
        $admin->form_start('../login.php', 'cplogin', false, 'cplogin');
        $admin->table_start(true, '425');
        $admin->table_head(T('Login to Bugdar'));
@@ -64,7 +64,7 @@ function admin_login()
        $admin->row_submit('', T('Login'));
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -133,9 +133,9 @@ function AdminPageNavigatorBitCallback($baselink, $nolink, $number, $paginator)
 function AdminPageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator)
 {
        global $stylevar;
-       
+
        $return = '';
-       
+
        if ($show['first'])
        {
                $return .= '<a href="' . $baselink . 'p=1&amp;pp=' . $paginator->getPerPage() . '">' . T('First') . '</a> ...';
@@ -144,9 +144,9 @@ function AdminPageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pag
        {
                $return .= '<a href="' . $baselink . 'p=' . $prevpage . '&amp;pp=' . $paginator->getPerPage() . '">' . T('Prev') . '</a> ...';
        }
-       
+
        $return .= $pagebits;
-       
+
        if ($show['next'])
        {
                $return .= '... <a href="' . $baselink . 'p=' . $nextpage . '&amp;pp=' . $paginator->getPerPage() . '">' . T('Next') . '</a>';
index e61b7ea13fbd95923521142a794297489f282443..2d810674a1b77685f4a3fa6c8494ab6af1ca866d 100644 (file)
@@ -48,7 +48,7 @@ if ($_REQUEST['do'] == 'kill')
        $language->set('languageid',    $bugsys->in['languageid']);
        $language->set_condition();
        $language->delete();
-       
+
        $admin->redirect('language.php?do=modify');
 }
 
@@ -70,7 +70,7 @@ if ($_POST['do'] == 'insert')
        $language->set('userselect',    $bugsys->in['userselect']);
        $language->set('langcode',              $bugsys->in['langcode']);
        $language->insert();
-       
+
        $admin->redirect('language.php?do=modify');
 }
 
@@ -80,13 +80,13 @@ if ($_REQUEST['do'] == 'add')
 {
        NavLinks::languagesAdd();
        $navigator->set_focus('link', 'options-languages-add', 'options-languages');
-       
+
        $admin->page_start(T('New Language'));
-       
+
        $admin->form_start('language.php', 'insert');
        $admin->table_start();
        $admin->table_head(T('New Language'));
-       
+
        $admin->row_input(T('Title'), 'title');
        $admin->row_input(T('Gettext Language Code (<em><a href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_15.html">language</a></em>_<em><a href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_16.html">COUNTRY</a></em>)'), 'langcode');
        $admin->row_input(T('Character Set'), 'charset', 'utf-8');
@@ -94,11 +94,11 @@ if ($_REQUEST['do'] == 'add')
        $admin->list_item(T('Right-to-Left'), 'rtl');
        $admin->row_list(T('Direction'), 'direction');
        $admin->row_yesno(T('User Selectable'), 'userselect', true);
-       
+
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -115,7 +115,7 @@ if ($_POST['do'] == 'update')
        $language->set('userselect',    $bugsys->in['userselect']);
        $language->set('langcode',              $bugsys->in['langcode']);
        $language->update();
-       
+
        $admin->redirect('language.php?do=modify');
 }
 
@@ -125,22 +125,22 @@ if ($_REQUEST['do'] == 'edit')
 {
        NavLinks::languagesEdit($bugsys->in['languageid']);
        $navigator->set_focus('link', 'options-languages-edit', 'options-languages');
-       
+
        $languageapi = new LanguageAPI($bugsys);
        $languageapi->set('languageid', $bugsys->in['languageid']);
        $languageapi->set_condition();
        $languageapi->fetch();
-       
+
        $language =& $languageapi->objdata;
-       
+
        $admin->page_start(T('Edit Language'));
-       
+
        $admin->form_start('language.php', 'update');
        $admin->table_start();
        $admin->table_head(sprintf(T('Edit Language - %1$s'), $language['title']));
-       
+
        $admin->form_hidden_field('languageid', $language['languageid']);
-       
+
        $admin->row_input(T('Title'), 'title', $language['title']);
        $admin->row_input(T('Gettext Language Code (<em><a href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_15.html">language</a></em>_<em><a href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_16.html">COUNTRY</a></em>)'), 'langcode', $language['langcode']);
        $admin->row_input(T('Character Set'), 'charset', $language['charset']);
@@ -148,11 +148,11 @@ if ($_REQUEST['do'] == 'edit')
        $admin->list_item(T('Right-to-Left'), 'rtl', (($language['direction'] == 'rtl') ? true : false));
        $admin->row_list(T('Direction'), 'direction');
        $admin->row_yesno(T('User Selectable'), 'userselect', $language['userselect']);
-       
+
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -162,14 +162,14 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::languagesAdd();
        $navigator->set_focus('link', 'options-pages-languages', 'options-pages');
-       
+
        $admin->page_start(T('Manage Languages'));
-               
+
        $admin->table_start();
        $admin->table_head(T('Manage Languages'), 3, 'language_manage');
-       
+
        $admin->table_column_head(array(T('Title'), T('Language Code / Charset'), T('Options')));
-       
+
        $languages = $db->query("SELECT * FROM " . TABLE_PREFIX . "language ORDER BY languageid ASC");
        while ($language = $db->fetch_array($languages))
        {
@@ -179,9 +179,9 @@ if ($_REQUEST['do'] == 'modify')
                        (($bugsys->options['defaultlanguage'] == $language['languageid']) ? '<strong>' . T('DEFAULT LANGUAGE') . '</strong> / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c'
                ));
        }
-       
+
        $admin->table_end();
-       
+
        $admin->page_end();
 }
 
index 8a7ffdcb21f2fa88bbd19e25345cb77a946d82fe..7d4f6934c15d8e6f79ec39d3e8510365b5b127c7 100644 (file)
@@ -43,7 +43,7 @@ $permissions = array(
                'canviewownhidden' => T('Can View Own Hidden Bugs'),
                'cansubscribe' => T('Can Subscribe to Bugs'),
        ),
-       
+
        T('Posting/Submitting Permissions') => array(
                'canvote' => T('Can Vote on Polls'),
                'cansubmitbugs' => T('Can Submit Bugs'),
@@ -52,7 +52,7 @@ $permissions = array(
                'canputattach' => T('Can Upload/Edit Own Attachments'),
                'caneditattach' => T('Can Manage All Attachments')
        ),
-       
+
        T('Moderation/Managment Permissions') => array(
                'caneditown' => T('Can Edit Own Bugs'),
                'caneditother' => T('Can Edit Others\' Bugs'),
@@ -77,9 +77,9 @@ if ($_REQUEST['do'] == 'kill')
 {
        $bugsys->input_clean('usergroupid', TYPE_UINT);
        $db->query("DELETE FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $bugsys->in['usergroupid'] . " AND productid = " . $bugsys->input_clean('productid', TYPE_UINT));
-       
+
        build_permissions();
-       
+
        $admin->redirect('permission.php?do=modify&usergroupid=' . $bugsys->in['usergroupid']);
 }
 
@@ -101,18 +101,18 @@ if ($_REQUEST['do'] == 'edit')
        $perm = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = " . $bugsys->in['usergroupid'] . " AND productid = " . $bugsys->in['productid']);
        $usergroup = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $bugsys->in['usergroupid']);
        $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']);
-       
+
        if (!$usergroup OR !$product)
        {
                $admin->error(L_INVALID_ID);
        }
-       
+
        $admin->page_start(T('Edit Permissions'));
-       
+
        $admin->form_start('permission.php', 'update');
        $admin->form_hidden_field('usergroupid', $usergroup['usergroupid']);
        $admin->form_hidden_field('productid', $product['productid']);
-       
+
        // determine the value to work off of
        if ($perm)
        {
@@ -122,11 +122,11 @@ if ($_REQUEST['do'] == 'edit')
        {
                $mask = $usergroup['permissions'];
        }
-       
+
        // Permission
        $admin->table_start();
        $admin->table_head(sprintf(T('Permissions: %1$s - %2$s'), $usergroup['title'], $product['title']));
-       
+
        foreach ($permissions AS $group => $settings)
        {
                $admin->row_span($group, 'thead', 'center');
@@ -155,7 +155,7 @@ if ($_POST['do'] == 'update')
        {
                $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch;
        }
-       
+
        $db->query("
                REPLACE INTO " . TABLE_PREFIX . "permission
                        (usergroupid, productid, mask)
@@ -165,9 +165,9 @@ if ($_POST['do'] == 'update')
                        $permissionvalue
                )"
        );
-       
+
        build_permissions();
-       
+
        $admin->redirect('permission.php?do=modify&usergroupid=' . $bugsys->in['usergroupid']);
 }
 
@@ -176,21 +176,21 @@ if ($_POST['do'] == 'update')
 if ($_REQUEST['do'] == 'modify')
 {
        $admin->page_start(T('Permission Manager'));
-       
+
        $admin->table_start();
        $admin->table_head(T('Permission Manager'));
-       
+
        $groups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid ASC");
        while ($group = $db->fetch_array($groups))
        {
                $usergroups["$group[usergroupid]"] = $group;
        }
        $db->free_result($groups);
-       
+
        foreach ($usergroups AS $group)
        {
                $admin->row_text($group['title'], ($bugsys->in['usergroupid'] != $group['usergroupid'] ? "<a href=\"permission.php?do=modify&amp;usergroupid=$group[usergroupid]\">[" . T('Expand') . "]</a>" : ''), 'top', 2, 'alt3');
-               
+
                if ($bugsys->in['usergroupid'] == $group['usergroupid'])
                {
                        $permissions_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "permission WHERE usergroupid = $group[usergroupid]");
@@ -198,13 +198,13 @@ if ($_REQUEST['do'] == 'modify')
                        {
                                $permissions["$permission[productid]"] = $permission['mask'];
                        }
-                       
+
                        $products_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "product WHERE !parentid OR parentid IS NULL ORDER BY displayorder ASC");
                        while ($product = $db->fetch_array($products_fetch))
                        {
                                $groupid = $group['usergroupid'];
                                $prodid = $product['productid'];
-                               
+
                                if (!isset($permissions["$product[productid]"]))
                                {
                                        $statuslink = T('Inherited From Usergroup Settings: ');
@@ -216,14 +216,14 @@ if ($_REQUEST['do'] == 'modify')
                                        $statuslink .= "<a href=\"permission.php?do=edit&amp;usergroupid=$groupid&amp;productid=$prodid\">[" . T('Edit') . ']</a>';
                                        $statuslink .= " <a href=\"permission.php?do=delete&amp;usergroupid=$groupid&amp;productid=$prodid\">[" . T('Revert') . ']</a>';
                                }
-                               
+
                                $admin->row_text($product['title'], $statuslink);
                        }
                }
        }
-       
+
        $admin->table_end();
-       
+
        $admin->page_end();
 }
 
index ef7dc6a8f381bc8d95e2c072c5d5e94692ac5f6a..16192200a6e8f6ac58a96e53df2a302d2387212e 100644 (file)
@@ -48,7 +48,7 @@ if ($_REQUEST['do'] == 'kill')
        $priority->set('priorityid',    $bugsys->in['priorityid']);
        $priority->set_condition();
        $priority->delete();
-       
+
        $admin->redirect('priority.php?do=modify');
 }
 
@@ -67,7 +67,7 @@ if ($_POST['do'] == 'insert')
        $priority->set('priority',              $bugsys->in['priority']);
        $priority->set('displayorder',  $bugsys->in['displayorder']);
        $priority->insert();
-       
+
        $admin->redirect('priority.php?do=modify');
 }
 
@@ -77,9 +77,9 @@ if ($_REQUEST['do'] == 'add')
 {
        NavLinks::prioritiesAdd();
        $navigator->set_focus('link', 'priorities-add', 'priorities');
-       
+
        $admin->page_start(T('Add New Priority'));
-       
+
        $admin->form_start('priority.php', 'insert');
        $admin->table_start();
        $admin->table_head(T('New Priority'));
@@ -88,7 +88,7 @@ if ($_REQUEST['do'] == 'add')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -102,7 +102,7 @@ if ($_POST['do'] == 'update')
        $priority->set('priority',              $bugsys->in['priority']);
        $priority->set('displayorder',  $bugsys->in['displayorder']);
        $priority->update();
-       
+
        $admin->redirect('priority.php?do=modify');
 }
 
@@ -112,14 +112,14 @@ if ($_REQUEST['do'] == 'edit')
 {
        NavLinks::prioritiesEdit($bugsys->in['priorityid']);
        $navigator->set_focus('link', 'fields-pages-priorities', 'fields-pages');
-       
+
        $priority = new PriorityAPI($bugsys);
        $priority->set('priorityid',    $bugsys->in['priorityid']);
        $priority->set_condition();
        $priority->fetch();
-       
+
        $admin->page_start(T('Edit Priority'));
-       
+
        $admin->form_start('priority.php', 'update');
        $admin->form_hidden_field('priorityid', $priority->objdata['priorityid']);
        $admin->table_start();
@@ -129,7 +129,7 @@ if ($_REQUEST['do'] == 'edit')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -139,24 +139,24 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::prioritiesAdd();
        $navigator->set_focus('link', 'fields-pages-priorities', 'fields-pages');
-       
+
        $admin->page_start(T('Priority Manager'));
-       
+
        $priorities = $db->query("SELECT * FROM " . TABLE_PREFIX . "priority ORDER BY displayorder");
-       
+
        $admin->form_start('priority.php', 'null');
        $admin->table_start();
        $admin->table_head(T('Priority Manager'));
-       
+
        while ($priority = $db->fetch_array($priorities))
        {
                $admin->row_text("$priority[displayorder]: <a href=\"priority.php?do=edit&amp;priorityid=$priority[priorityid]\">$priority[priority]</a>", "(priorityid: $priority[priorityid]) <a href=\"priority.php?do=edit&amp;priorityid=$priority[priorityid]\">[" . T('Edit') . "]</a> <a href=\"priority.php?do=delete&amp;priorityid=$priority[priorityid]\">[" . T('Delete') . "]</a>");
        }
        $db->free_result($priorities);
-       
+
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
index 3ccb9c3b532fc12e1a9ab44cd5bbb2ec0536b14f..3cbfcf1ccc9750f0c732ead2c2b5c419a211926e 100644 (file)
@@ -35,36 +35,36 @@ if (!can_perform('canadminversions'))
 function construct_option_list($type_display, $type, $id, $edit, $addcomponent, $addversion, $delete, $displayorder)
 {
        global $bugsys;
-       
+
        $type = ($type == 'component' ? 'product' : $type);
        $type_action = (($type == 'version') ? 'versionid' : 'productid');
-       
+
        if ($edit)
        {
                $opt .= '<option value="product.php?do=edit' . $type . '&' . $type_action . '=' . $id . '">' . sprintf(T('Edit %1$s'), $type_display) . '</option>';
        }
-       
+
        if ($delete)
        {
                $opt .= '<option value="product.php?do=delete' . $type . '&' . $type_action . '=' . $id . '">' . sprintf(T('Delete %1$s'), $type_display) . '</option>';
        }
-       
+
        if ($addcomponent)
        {
                $opt .= '<option value="product.php?do=addproduct&productid=' . $id . '">' . T('Add Component') . '</option>';
        }
-       
+
        if ($addversion)
        {
                $opt .= '<option value="product.php?do=addversion&productid=' . $id . '">' . T('Add Version') . '</option>';
        }
-       
+
        $type = strtolower($type);
-       
+
        $name = $type . '_' . $id;
-       
+
        $displayorder = (($displayorder != -1) ? '<input type="text" name="displayorder[' . $name . ']" value="' . $displayorder . '" size="4" class="input" /> ' : '');
-       
+
        return $displayorder . '<select id="' . $name . '" name="' . $name . '" onchange="exec_action(\'' . $name . '\')" class="input">' . $opt . '</select> <input type="button" class="button" name="gobutton" value="  ' . T('Go') . '  " onclick="exec_action(\'' . $name . '\')" />';
 }
 
@@ -82,9 +82,9 @@ if ($_REQUEST['do'] == 'killversion')
        $bugsys->input_clean('versionid', TYPE_UINT);
        $db->query("DELETE FROM " . TABLE_PREFIX . "version WHERE versionid = " . $bugsys->in['versionid']);
        $db->query("DELETE FROM " . TABLE_PREFIX . "bug WHERE version = " . $bugsys->in['versionid']);
-       
+
        build_versions();
-       
+
        $admin->redirect('product.php?do=modify');
 }
 
@@ -110,7 +110,7 @@ if ($_REQUEST['do'] == 'addversion')
 {
        NavLinks::productsEdit($bugsys->input_clean('productid', TYPE_UINT));
        $navigator->set_focus('link', 'products-edit-version', 'products-edit');
-       
+
        if ($bugsys->in['productid'] != -1)
        {
                $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']);
@@ -123,9 +123,9 @@ if ($_REQUEST['do'] == 'addversion')
        {
                $bugsys->in['productid'] = 0;
        }
-       
+
        $admin->page_start(T('Add Version'));
-       
+
        $admin->form_start('product.php', 'insertversion');
        $admin->form_hidden_field('productid', $bugsys->in['productid']);
        $admin->table_start();
@@ -136,7 +136,7 @@ if ($_REQUEST['do'] == 'addversion')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -148,10 +148,10 @@ if ($_REQUEST['do'] == 'updateversion')
        {
                $admin->error(T('Please fill in a version number.'));
        }
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "version SET version = '" . $bugsys->input_escape('version') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . ", obsolete = " . $bugsys->input_clean('obsolete', TYPE_UINT) . " WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT));
        build_versions();
-       
+
        $admin->redirect('product.php?do=modify');
 }
 
@@ -160,13 +160,13 @@ if ($_REQUEST['do'] == 'updateversion')
 if ($_REQUEST['do'] == 'editversion')
 {
        $admin->page_start(T('Edit Version'));
-       
+
        $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "version WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT));
        if (!is_array($version))
        {
                $admin->error(L_INVALID_ID);
        }
-       
+
        $admin->form_start('product.php', 'updateversion');
        $admin->form_hidden_field('versionid', $version['versionid']);
        $admin->table_start();
@@ -177,7 +177,7 @@ if ($_REQUEST['do'] == 'editversion')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -191,13 +191,13 @@ if ($_REQUEST['do'] == 'killproduct')
        {
                $list[] = $prod['productid'];
        }
-       
+
        $db->query("DELETE FROM " . TABLE_PREFIX . "product WHERE productid IN (" . implode(', ', $list) . ")");
        $db->query("DELETE FROM " . TABLE_PREFIX . "version WHERE productid IN (" . implode(', ', $list) . ")");
        $db->query("DELETE FROM " . TABLE_PREFIX . "bug WHERE product IN (" . implode(', ', $list) . ")");
-       
+
        build_products();
-       
+
        $admin->redirect('product.php?do=modify');
 }
 
@@ -216,7 +216,7 @@ if ($_REQUEST['do'] == 'insertproduct')
        {
                $admin->error(T('Please go back and fill in the title field.'));
        }
-       
+
        $db->query("
                INSERT INTO " . TABLE_PREFIX . "product
                        (title, parentid, description, displayorder)
@@ -226,7 +226,7 @@ if ($_REQUEST['do'] == 'insertproduct')
                )"
        );
        build_products();
-       
+
        $admin->redirect('product.php?do=modify');
 }
 
@@ -243,9 +243,9 @@ if ($_REQUEST['do'] == 'addproduct')
                NavLinks::productsAdd();
        }
        $navigator->set_focus('link', 'products-add', 'products');
-       
+
        $admin->page_start(T('Add New Product'));
-       
+
        $admin->form_start('product.php', 'insertproduct');
        $admin->form_hidden_field('parentid', $bugsys->in['productid']);
        $admin->table_start();
@@ -256,7 +256,7 @@ if ($_REQUEST['do'] == 'addproduct')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -268,15 +268,15 @@ if ($_REQUEST['do'] == 'updateproduct')
        {
                $admin->error(T('Please go back and fill in the title field.'));
        }
-       
+
        if (empty($bugsys->in['productid']))
        {
                $admin->error(L_INVALID_ID);
        }
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "product SET title = '" . $bugsys->input_escape('title') . "', description = '" . $bugsys->input_escape('description') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . " WHERE productid = " . $bugsys->input_clean('productid', TYPE_UINT));
        build_products();
-       
+
        $admin->redirect('product.php?do=modify');
 }
 
@@ -286,15 +286,15 @@ if ($_REQUEST['do'] == 'editproduct')
 {
        NavLinks::productsEdit($bugsys->input_clean('productid', TYPE_UINT));
        $navigator->set_focus('link', 'products-edit', 'products-edit');
-       
+
        $admin->page_start(T('Edit Product'));
-       
+
        $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']);
        if (!is_array($product))
        {
                $admin->error(L_INVALID_ID);
        }
-       
+
        $admin->form_start('product.php', 'updateproduct');
        $admin->form_hidden_field('productid', $product['productid']);
        $admin->table_start();
@@ -305,7 +305,7 @@ if ($_REQUEST['do'] == 'editproduct')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -337,9 +337,9 @@ if ($_POST['do'] == 'displayorder')
 if ($_REQUEST['do'] == 'modify')
 {
        $navigator->set_focus('link', 'products-manage', 'products');
-       
+
        $admin->page_start(T('Products and Versions'));
-       
+
        $javascript = <<<EOF
 <script type="text/javascript">
 <!--
@@ -350,11 +350,11 @@ if ($_REQUEST['do'] == 'modify')
 //-->
 </script>
 EOF;
-       
+
        $admin->page_code($javascript);
-       
+
        $admin->form_start('product.php', 'displayorder');
-       
+
        $products_get = $db->query("SELECT * FROM " . TABLE_PREFIX . "product ORDER BY displayorder ASC");
        $products = array();
        while ($prod = $db->fetch_array($products_get))
@@ -369,17 +369,17 @@ EOF;
                }
                $version["$prod[productid]"] = array();
        }
-       
+
        $versions_get = $db->query("SELECT * FROM " . TABLE_PREFIX . "version ORDER BY displayorder ASC");
        $versions = array();
        while ($vers = $db->fetch_array($versions_get))
        {
                $versions["$vers[productid]"]["$vers[versionid]"] = $vers;
        }
-       
+
        $admin->table_start();
        $admin->table_head(T('Products / Versions'));
-       
+
        // Handle our global versions
        if (is_array($versions['0']))
        {
@@ -389,13 +389,13 @@ EOF;
                        $admin->row_text('-- ' . $version['version'], construct_option_list(T('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2');
                }
        }
-       
+
        // Now let's do the rest of the versions
        foreach ($products AS $product)
        {
                // Product
                $admin->row_text("<a href=\"product.php?do=editproduct&amp;productid=$product[productid]\">$product[title]</a>", construct_option_list(T('Product'), 'product', $product['productid'], 1, 1, 1, 1, $product['displayorder']), 'middle', 2, 'alt3');
-               
+
                // Versions
                if (is_array($versions["$product[productid]"]))
                {
@@ -404,14 +404,14 @@ EOF;
                                $admin->row_text('-- ' . $version['version'], construct_option_list(T('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2');
                        }
                }
-               
+
                // Components
                if (is_array($components["$product[productid]"]))
                {
                        foreach ($components["$product[productid]"] AS $comp)
                        {
                                $admin->row_text("-- <a href=\"product.php?do=editproduct&amp;productid=$comp[productid]\">$comp[title]</a>", construct_option_list(T('Component'), 'component', $comp['productid'], 1, 0, 1, 1, $comp['displayorder']), 'middle', 2, 'alt1');
-                               
+
                                // Component versions
                                if (is_array($versions["$comp[productid]"]))
                                {
@@ -423,13 +423,13 @@ EOF;
                        }
                }
        }
-       
+
        $admin->row_submit(null, T('Save Display Order'), null);
-       
+
        $admin->table_end();
-       
+
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
index 7ea920205ef0c9df9c2b1c19ece46b66437a4cc1..dcabe421b455c1a70159d4115f97ea80233afd55 100644 (file)
@@ -60,7 +60,7 @@ if ($_REQUEST['do'] == 'kill')
                $data->set_condition();
                $data->delete();
        }
-       
+
        $admin->redirect('purge_inactive.php');
 }
 
@@ -76,20 +76,20 @@ if ($_REQUEST['do'] == 'delete')
 if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::usersAdd();
-       
+
        LoadPaginationFramework();
        $pagination->setBitProcessor('AdminPageNavigatorBitCallback');
        $pagination->setNavigatorProcessor('AdminPageNavigatorCallback');
-       
+
        $admin->page_start(T('Inactive Users'));
        $admin->table_start();
        $admin->table_head(T('Users Awaiting Email Confirmation for more than 30 Days'), 4);
        $admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions')));
-               
+
        $count = $db->query_first("SELECT COUNT(*) AS count FROM ($query) AS inactive");
        $pagination->setTotal($count['count']);
        $pagination->splitPages();
-       
+
        $users = $db->query("
                $query
                ORDER BY userid ASC LIMIT " . $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage()
@@ -103,12 +103,12 @@ if ($_REQUEST['do'] == 'modify')
                        '<a href="user.php?do=edit&amp;userid=' . $user['userid'] . '">[' . T('Edit') . ']</a>' => 'c'
                ));
        }
-       
+
        $admin->row_tfoot('<a href="purge_inactive.php?do=delete">[Remove All]</a>', 4);
-       
+
        $admin->table_end();
-       
+
        $admin->page_code($pagination->constructPageNav('purge_inactive.php'));
-       
+
        $admin->page_end();
 }
index 649a024902a001abfa7224f08a725db09a9a3448..be452fcf89911c17bc744936c62710bf56817cdb 100644 (file)
@@ -48,7 +48,7 @@ if ($_REQUEST['do'] == 'kill')
        $resolution->set('resolutionid',        $bugsys->in['resolutionid']);
        $resolution->set_condition();
        $resolution->delete();
-       
+
        $admin->redirect('resolution.php?do=modify');
 }
 
@@ -67,7 +67,7 @@ if ($_POST['do'] == 'insert')
        $resolution->set('resolution',          $bugsys->in['resolution']);
        $resolution->set('displayorder',        $bugsys->in['displayorder']);
        $resolution->insert();
-       
+
        $admin->redirect('resolution.php?do=modify');
 }
 
@@ -77,9 +77,9 @@ if ($_REQUEST['do'] == 'add')
 {
        NavLinks::resolutionsAdd();
        $navigator->set_focus('link', 'resolutions-add', 'resolutions');
-       
+
        $admin->page_start(T('Add New Resolution'));
-       
+
        $admin->form_start('resolution.php', 'insert');
        $admin->table_start();
        $admin->table_head(T('New Resolution'));
@@ -88,7 +88,7 @@ if ($_REQUEST['do'] == 'add')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -102,7 +102,7 @@ if ($_POST['do'] == 'update')
        $resolution->set('resolution',          $bugsys->in['resolution']);
        $resolution->set('displayorder',        $bugsys->in['displayorder']);
        $resolution->update();
-       
+
        $admin->redirect('resolution.php?do=modify');
 }
 
@@ -112,14 +112,14 @@ if ($_REQUEST['do'] == 'edit')
 {
        NavLinks::resolutionsEdit($bugsys->in['resolutionid']);
        $navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages');
-       
+
        $resolution = new ResolutionAPI($bugsys);
        $resolution->set('resolutionid',        $bugsys->in['resolutionid']);
        $resolution->set_condition();
        $resolution->fetch();
-       
+
        $admin->page_start(T('Edit Resolution'));
-       
+
        $admin->form_start('resolution.php', 'update');
        $admin->form_hidden_field('resolutionid', $resolution->objdata['resolutionid']);
        $admin->table_start();
@@ -129,7 +129,7 @@ if ($_REQUEST['do'] == 'edit')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -139,24 +139,24 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::resolutionsAdd();
        $navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages');
-       
+
        $admin->page_start(T('Resolution Manager'));
-       
+
        $resolutions = $db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder");
-       
+
        $admin->form_start('resolution.php', 'null');
        $admin->table_start();
        $admin->table_head(T('Resolution Manager'));
-       
+
        while ($resolution = $db->fetch_array($resolutions))
        {
                $admin->row_text("$resolution[displayorder]: <a href=\"resolution.php?do=edit&amp;resolutionid=$resolution[resolutionid]\">$resolution[resolution]</a>", "(resolutionid: $resolution[resolutionid]) <a href=\"resolution.php?do=edit&amp;resolutionid=$resolution[resolutionid]\">[" . T('Edit') . "]</a> <a href=\"resolution.php?do=delete&amp;resolutionid=$resolution[resolutionid]\">[" . T('Delete') . "]</a>");
        }
        $db->free_result($resolutions);
-       
+
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
index bae5916d103760dc65c4356f0a7a6a8f84923b8f..c573e553b3740f4902f9b18b95d66cfe730eb8e1 100644 (file)
@@ -57,14 +57,14 @@ if ($_POST['do'] == 'update')
                                $value = implode(',', $value);
                        }
                }
-               
+
                $updates[] = "('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($value) . "')";
        }
-       
+
        $db->query("REPLACE INTO " . TABLE_PREFIX . "setting (varname, value) VALUES " . implode(',', $updates));
-       
+
        build_settings();
-       
+
        $admin->redirect('setting.php');
 }
 
@@ -73,15 +73,15 @@ if ($_POST['do'] == 'update')
 if ($_REQUEST['do'] == 'modify')
 {
        $admin->page_start(T('Settings'));
-       
+
        $admin->form_start('setting.php', 'update');
-       
+
        $IS_SETTINGS = true;
-       
+
        // ###################################################################
        $admin->table_start();
        $admin->table_head(T('General Options'));
-       
+
        // authmethod
        $admin->row_span(T('Authentication Method'), 'thead');
        $methods = $funct->scandir('./includes/auth/');
@@ -93,131 +93,131 @@ if ($_REQUEST['do'] == 'modify')
                }
        }
        $admin->row_list(T('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.'), 'setting[authmethod]');
-       
+
        // allownewreg
        $admin->row_span(T('Allow New Registrations'), 'thead');
        $admin->row_yesno(T('If this is set to <em>yes</em>, then new users will be allowed to register.'), 'setting[allownewreg]', $bugsys->options['allownewreg']);
-       
+
        // verifyemail
        $admin->row_span(T('Require Activation Email'), 'thead');
        $admin->row_yesno(T('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', $bugsys->options['verifyemail']);
-       
+
        // moderatenewusers
        $admin->row_span(T('Moderate New Users'), 'thead');
        $admin->row_yesno(T('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', $bugsys->options['moderatenewusers']);
-       
+
        // sendwelcomemail
        $admin->row_span(T('Send New Use Welcome Email'), 'thead');
        $admin->row_yesno(T('Setting this option to <em>yes</em> will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', $bugsys->options['sendwelcomemail']);
-       
+
        // webmasteremail
        $admin->row_span(T('Webmaster Email Address'), 'thead');
        $admin->row_input(T('The email address from which emails will be sent out.'), 'setting[webmasteremail]', $bugsys->options['webmasteremail']);
-       
+
        // trackertitle
        $admin->row_span(T('Tracker Title'), 'thead');
        $admin->row_input(T('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', $bugsys->options['trackertitle']);
-       
+
        // trackerurl
        $admin->row_span(T('Tracker Base URL'), 'thead');
        $admin->row_input(T('The base URL of the tracker. This is used when creating external links to the tracker. <strong>Be sure that this does not end in a trailing slash (&quot;/&quot;).</strong><br />Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', $bugsys->options['trackerurl']);
-       
+
        // dateformat
        $admin->row_span(T('Date Format'), 'thead');
        $admin->row_input(T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', $bugsys->options['dateformat']);
-       
+
        // defaulttimezone
        $admin->row_span(T('Default Time Zone'), 'thead');
        $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), $bugsys->options['defaulttimezone']), $bugsys->options['defaulttimezone']);
-       
+
        // defaultlanguage
        $admin->row_span(T('Default Language'), 'thead');
        $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', bugdar::$datastore['language'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']);
-       
+
        // syndicateditems
        $admin->row_span(T('Number of Syndicated Items'), 'thead');
        $admin->row_input(T('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', $bugsys->options['syndicateditems']);
-       
+
        // redirectheaders
        $admin->row_span(T('Use Header Redirects'), 'thead');
        $admin->row_yesno(T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', $bugsys->options['redirectheaders']);
-       
+
        $admin->table_end();
-       
+
        // ###################################################################
        $admin->table_start();
        $admin->table_head(T('Bug Reporting Options'));
-       
+
        // allowhtml
        $admin->row_span(T('Allow HTML in Bug Reports'), 'thead');
        $admin->row_yesno(T('Set this to <em>yes</em> if you want to allow users to post raw HTML in their bug reports. This is <strong>very</strong> dangerous and it is not recommended.'), 'setting[allowhtml]', $bugsys->options['allowhtml']);
-       
+
        // defaultseverity
        $admin->row_span(T('Default Severity'), 'thead');
        $admin->row_text(T('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', bugdar::$datastore['severity'],  $bugsys->options['defaultseverity'], 'severityid', 'severity'));
-       
+
        // defaultpriority
        $admin->row_span(T('Default Priority'), 'thead');
        $admin->row_text(T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', bugdar::$datastore['priority'],  $bugsys->options['defaultpriority'], 'priorityid', 'priority'));
-       
+
        // defaultstatus
        $admin->row_span(T('Default Status'), 'thead');
        $admin->row_text(T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', bugdar::$datastore['status'],  $bugsys->options['defaultstatus'], 'statusid', 'status'));
-       
+
        // defaultresolve
        $admin->row_span(T('Default Resolution'), 'thead');
        $admin->row_text(T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', bugdar::$datastore['resolution'],  $bugsys->options['defaultresolve'], 'resolutionid', 'resolution'));
-       
+
        // defaultassign
        $admin->row_span(T('Default Bug Assignment'), 'thead');
        $admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as <em>Not Selected</em>.'), construct_option_select('setting[defaultassign]', bugdar::$datastore['assignto'],  $bugsys->options['defaultassign'], 'userid', 'displayname', 0));
-       
+
        // defaultcomment
        $admin->row_span(T('Default Comment Text'), 'thead');
        $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', $bugsys->options['defaultcomment']);
-       
+
        $admin->table_end();
-       
+
        // ###################################################################
        $admin->table_start();
        $admin->table_head(T('Bug Listing Display Options'));
-       
+
        // hidestatuses
        $admin->row_span(T('Hide Statuses on Bug Listings'), 'thead');
        $admin->row_text(T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', bugdar::$datastore['status'], $bugsys->options['hidestatuses'], 'statusid', 'status', 0, true));
-       
+
        // defaultsortkey
        $admin->row_span(T('Default Sort Column'), 'thead');
        $admin->row_text(T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false), $bugsys->options['defaultsortkey']));
-       
+
        // defaultsortas
        $admin->row_span(T('Default Sort Direction'), 'thead');
        $admin->row_text(T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), $bugsys->options['defaultsortas']));
-       
+
        // columnoptions
        $admin->row_span(T('Default Column Ordering Options'), 'thead');
        $admin->row_text(T('Specify the order of the columns for bug listings. The value 0 disables the display of a column and if two or more columns have the same position number, they will be displayed in the same column.'), ConstructColumnOptionsSetting());
-       
+
        $admin->table_end();
-       
+
        // ###################################################################
        $admin->table_start();
        $admin->table_head(T('Pagination Options'));
-       
+
        // defaultpp
        $admin->row_span(T('Default Per-Page Amount'), 'thead');
        $admin->row_input(T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', $bugsys->options['defaultpp']);
-       
+
        // maxpp
        $admin->row_span(T('Maximum Per-Page Value'), 'thead');
        $admin->row_input(T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', $bugsys->options['maxpp']);
-       
+
        // pagelinks
        $admin->row_span(T('Number of Page Links'), 'thead');
        $admin->row_input(T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', $bugsys->options['pagelinks']);
-       
+
        $admin->table_end();
-       
+
        // ###################################################################
        if (DEVDEBUG)
        {
@@ -234,7 +234,7 @@ if ($_REQUEST['do'] == 'modify')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -247,9 +247,9 @@ if ($_REQUEST['do'] == 'modify')
 function ConstructColumnOptionsSetting()
 {
        global $bugsys;
-       
+
        $array = ($bugsys->options['columnoptions'] == null ? array('bugid' => 1, 'summary' => 2, 'userid' => 2, 'product' => 3, 'version' => 3, 'component' => 0, 'status' => 4, 'resolution' => 4, 'priority' => 5, 'severity' => 5, 'lastpost' => 6, 'votes' => 0) : $bugsys->options['columnoptions']);
-       
+
        $return = '<table cellspacing="2" cellpadding="1" border="0">';
        foreach ($bugsys->columns AS $column => $mask)
        {
index 0a39dc0fae2bfeb7238632a2e81b2c65a66c50d0..66bdd81c8df89f27b40369ee2c250253aee1c5ce 100644 (file)
@@ -48,7 +48,7 @@ if ($_REQUEST['do'] == 'kill')
        $severity->set('severityid',    $bugsys->in['severityid']);
        $severity->set_condition();
        $severity->delete();
-       
+
        $admin->redirect('severity.php?do=modify');
 }
 
@@ -67,7 +67,7 @@ if ($_POST['do'] == 'insert')
        $severity->set('severity',              $bugsys->in['severity']);
        $severity->set('displayorder',  $bugsys->in['displayorder']);
        $severity->insert();
-       
+
        $admin->redirect('severity.php?do=modify');
 }
 
@@ -77,9 +77,9 @@ if ($_REQUEST['do'] == 'add')
 {
        NavLinks::severitiesAdd();
        $navigator->set_focus('link', 'severities-add', 'severities');
-       
+
        $admin->page_start(T('Add New Severity'));
-       
+
        $admin->form_start('severity.php', 'insert');
        $admin->table_start();
        $admin->table_head(T('New Severity'));
@@ -88,7 +88,7 @@ if ($_REQUEST['do'] == 'add')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -102,7 +102,7 @@ if ($_POST['do'] == 'update')
        $severity->set('severity',              $bugsys->in['severity']);
        $severity->set('displayorder',  $bugsys->in['displayorder']);
        $severity->update();
-       
+
        $admin->redirect('severity.php?do=modify');
 }
 
@@ -112,14 +112,14 @@ if ($_REQUEST['do'] == 'edit')
 {
        NavLinks::severitiesEdit($bugsys->in['severityid']);
        $navigator->set_focus('link', 'fields-pages-severities', 'fields-pages');
-       
+
        $severity = new SeverityAPI($bugsys);
        $severity->set('severityid',    $bugsys->in['severityid']);
        $severity->set_condition();
        $severity->fetch();
-       
+
        $admin->page_start(T('Edit Severity'));
-       
+
        $admin->form_start('severity.php', 'update');
        $admin->form_hidden_field('severityid', $severity->objdata['severityid']);
        $admin->table_start();
@@ -129,7 +129,7 @@ if ($_REQUEST['do'] == 'edit')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -139,24 +139,24 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::severitiesAdd();
        $navigator->set_focus('link', 'fields-pages-severities', 'fields-pages');
-       
+
        $admin->page_start(T('Severity Manager'));
-       
+
        $severities = $db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder");
-       
+
        $admin->form_start('severity.php', 'null');
        $admin->table_start();
        $admin->table_head(T('Severity Manager'));
-       
+
        while ($severity = $db->fetch_array($severities))
        {
                $admin->row_text("$severity[displayorder]: <a href=\"severity.php?do=edit&amp;severityid=$severity[severityid]\">$severity[severity]</a>", "(severityid: $severity[severityid]) <a href=\"severity.php?do=edit&amp;severityid=$severity[severityid]\">[" . T('Edit') . "]</a> <a href=\"severity.php?do=delete&amp;severityid=$severity[severityid]\">[" . T('Delete') . "]</a>");
        }
        $db->free_result($severities);
-       
+
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
index 5765d49782ac3d7d3cf015ec425bee6255d860e6..f4c56a2c93322f880684dffa501c228bfc34f45f 100644 (file)
@@ -48,7 +48,7 @@ if ($_REQUEST['do'] == 'kill')
        $status->set('statusid',        $bugsys->in['statusid']);
        $status->set_condition();
        $status->delete();
-       
+
        $admin->redirect('status.php?do=modify');
 }
 
@@ -68,7 +68,7 @@ if ($_POST['do'] == 'insert')
        $status->set('color',                   $bugsys->in['color']);
        $status->set('displayorder',    $bugsys->in['displayorder']);
        $status->insert();
-       
+
        $admin->redirect('status.php?do=modify');
 }
 
@@ -78,9 +78,9 @@ if ($_REQUEST['do'] == 'add')
 {
        NavLinks::statusesAdd();
        $navigator->set_focus('link', 'statuses-add', 'statuses');
-       
+
        $admin->page_start(T('Add New Status'));
-       
+
        $admin->form_start('status.php', 'insert');
        $admin->table_start();
        $admin->table_head(T('New Status'));
@@ -90,7 +90,7 @@ if ($_REQUEST['do'] == 'add')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -105,7 +105,7 @@ if ($_POST['do'] == 'update')
        $status->set('color',                   $bugsys->in['color']);
        $status->set('displayorder',    $bugsys->in['displayorder']);
        $status->update();
-       
+
        $admin->redirect('status.php?do=modify');
 }
 
@@ -115,14 +115,14 @@ if ($_REQUEST['do'] == 'edit')
 {
        NavLinks::statusesEdit($bugsys->in['statusid']);
        $navigator->set_focus('link', 'fields-pages-statuses', 'fields-pages');
-       
+
        $status = new StatusAPI($bugsys);
        $status->set('statusid',        $bugsys->in['statusid']);
        $status->set_condition();
        $status->fetch();
-       
+
        $admin->page_start(T('Edit Status'));
-       
+
        $admin->form_start('status.php', 'update');
        $admin->form_hidden_field('statusid', $status->objdata['statusid']);
        $admin->table_start();
@@ -133,7 +133,7 @@ if ($_REQUEST['do'] == 'edit')
        $admin->row_submit();
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -143,23 +143,23 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::statusesAdd();
        $navigator->set_focus('link', 'fields-pages-statuses', 'fields-pages');
-       
+
        $admin->page_start(T('Status Manager'));
-       
+
        $statuses = $db->query("SELECT * FROM " . TABLE_PREFIX . "status");
-       
+
        $admin->table_start();
        $admin->table_head(T('Status Manager'));
-       
+
        while ($status = $db->fetch_array($statuses))
        {
                $colorblock = '<span style="float: right"><div style="height: 12px; width: 12px; background-color: ' . $status['color'] . '; border: 1px black solid"></div></span>';
                $admin->row_text("$colorblock$status[displayorder]: <a href=\"status.php?do=edit&amp;statusid=$status[statusid]\">$status[status]</a>", "(statusid: $status[statusid]) <a href=\"status.php?do=edit&amp;statusid=$status[statusid]\">[" . T('Edit') . "]</a> <a href=\"status.php?do=delete&amp;statusid=$status[statusid]\">[" . T('Delete') . "]</a>");
        }
        $db->free_result($statuses);
-       
+
        $admin->table_end();
-       
+
        $admin->page_end();
 }
 
index a7d560666448ee33f0c01d601dad2d46b5891369..e435923c670e530c5d07cd12c0e7c78f18f91837 100644 (file)
@@ -65,7 +65,7 @@ if ($_REQUEST['do'] == 'kill')
        $user->set('userid',    $bugsys->in['userid']);
        $user->set_condition();
        $user->delete();
-       
+
        $admin->redirect('user.php');
 }
 
@@ -95,10 +95,10 @@ if ($_POST['do'] == 'insert')
        $user->set('defaultsortkey',    $bugsys->in['defaultsortkey']);
        $user->set('defaultsortas',             $bugsys->in['defaultsortas']);
        $user->insert();
-       
+
        // post_insert will set the email options... so we now have to dump them
        $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->insertid);
-       
+
        $bugsys->input_clean('emailopts', TYPE_INT);
        if (is_array($bugsys->in['emailopts']))
        {
@@ -112,7 +112,7 @@ if ($_POST['do'] == 'insert')
                        $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . $user->insertid . ", $relation, $bitmask)");
                }
        }
-       
+
        $admin->redirect('user.php?do=edit&userid=' . $user->insertid);
 }
 
@@ -137,7 +137,7 @@ if ($_POST['do'] == 'update')
        $user->set('defaultsortkey',    $bugsys->in['defaultsortkey']);
        $user->set('defaultsortas',             $bugsys->in['defaultsortas']);
        $user->update();
-       
+
        $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->values['userid']);
        $bugsys->input_clean('emailopts', TYPE_INT);
        if (is_array($bugsys->in['emailopts']))
@@ -152,7 +152,7 @@ if ($_POST['do'] == 'update')
                        $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . $user->values['userid'] . ", $relation, $bitmask)");
                }
        }
-       
+
        $admin->redirect('user.php?do=edit&userid=' . $user->objdata['userid']);
 }
 
@@ -162,12 +162,12 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
 {
        $add = ($_REQUEST['do'] == 'add');
        $edit = (!$add);
-       
+
        if ($edit)
        {
                NavLinks::usersEdit($bugsys->in['userid']);
                $navigator->set_focus('link', 'users-pages-users', 'users-pages');
-               
+
                $user = new UserAPI($bugsys);
                $user->set('userid', $bugsys->in['userid']);
                $user->set_condition();
@@ -178,30 +178,30 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                NavLinks::usersAdd();
                $navigator->set_focus('link', 'users-add', 'users');
        }
-               
+
        $admin->page_start(($add ? T('Add User') : T('Edit User')));
-       
+
        $admin->form_start('user.php', ($add ? 'insert' : 'update'));
-       
+
        if ($edit)
        {
                $admin->form_hidden_field('userid', $user->objdata['userid']);
        }
-       
+
        $admin->table_start();
-       
+
        $admin->table_head(($add ? T('Add User') : sprintf(T('Edit User (userid: %1$s)'), $user->objdata['userid'])));
-       
+
        $admin->row_input(T('Display Name'), 'displayname', $user->objdata['displayname']);
        $admin->row_input(T('Email'), 'email', $user->objdata['email']);
        $admin->row_input(($add ? T('Password') : T('Password (Leave blank for no change)')), 'password');
-       
+
        foreach (bugdar::$datastore['usergroup'] AS $group)
        {
                $admin->list_item($group['title'], $group['usergroupid'], ($user->objdata['usergroupid'] == $group['usergroupid']));
        }
        $admin->row_list(T('Primary Usergroup'), 'usergroupid');
-       
+
        $ids = explode(',', $user->objdata['groupids']);
        foreach (bugdar::$datastore['usergroup'] AS $id => $group)
        {
@@ -212,33 +212,33 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                $admin->list_item($group['title'], $group['usergroupid'], in_array($id, $ids));
        }
        $admin->row_checkbox(T('Secondary Usergroups'), 'groupids');
-       
+
        $admin->row_yesno(T('Show Email Publicly'), 'showemail', $user->objdata['showemail']);
        $admin->row_yesno(T('Show Status Colors on Bug Listings'), 'showcolors', $user->objdata['showcolors']);
-       
+
        foreach (bugdar::$datastore['language'] AS $language)
        {
                $admin->list_item($language['title'], $language['languageid'], ($user->objdata['languageid'] == $language['languageid']));
        }
        $admin->row_list(T('Language'), 'languageid');
-       
+
        foreach ($datef->fetch_timezone_list() AS $value => $string)
        {
                $admin->list_item($string, $value, ($user->objdata['timezone'] == $value));
        }
        $admin->row_list(T('Timezone'), 'timezone');
-       
+
        $admin->row_yesno(T('Observe Daylight Savings Time (DST)'), 'usedst', $user->objdata['usedst']);
        $admin->row_text(T('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', bugdar::$datastore['status'], $user->objdata['hidestatuses'], 'statusid', 'status', 0, true));
        $admin->row_text(T('Default Sort Order Column'), construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $user->objdata['defaultsortkey']));
-       $admin->row_text(T('Default Sort Order Direction'), construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $user->objdata['defaultsortas']));       
-       
+       $admin->row_text(T('Default Sort Order Direction'), construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $user->objdata['defaultsortas']));
+
        $admin->table_end();
-       
+
        // -------------------------------------------------------------------
        $admin->table_start(false);
        $admin->table_head(T('Email Options'), 6);
-       
+
        if ($user->objdata['userid'])
        {
                $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->objdata['userid']);
@@ -256,15 +256,15 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                        }
                }
        }
-       
+
        $admin->table_column_head(array('', T('Reporter'), T('Assignee'), T('Favorite'), T('Voter'), T('Commenter')));
-       
+
        // -------------------------------------------------------------------
-       
+
        $admin->row_text(T('New bug is added'), '<div style="text-align: center">' . draw_checkbox('emailopts[0][2048]', $checked[0][2048]) . '</div>', 'top', 6);
-       
+
        $admin->row_text(T('I am made the assignee'), '<div style="text-align: center">' . draw_checkbox('emailopts[0][32]', $checked[0][32]) . '</div>', 'top', 6);
-       
+
        $admin->row_multi_item(array(
                T('Status or resolution changes') => 'l',
                draw_checkbox('emailopts[1][64]', $checked[1][64]) => 'c',
@@ -273,7 +273,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                draw_checkbox('emailopts[8][64]', $checked[8][64]) => 'c',
                draw_checkbox('emailopts[16][64]', $checked[16][64]) => 'c',
        ));
-       
+
        $admin->row_multi_item(array(
                T("'Duplicates' field is changed") => 'l',
                draw_checkbox('emailopts[1][128]', $checked[1][128]) => 'c',
@@ -282,7 +282,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                draw_checkbox('emailopts[8][128]', $checked[8][128]) => 'c',
                draw_checkbox('emailopts[16][128]', $checked[16][128]) => 'c',
        ));
-       
+
        $admin->row_multi_item(array(
                T('A new comment is added') => 'l',
                draw_checkbox('emailopts[1][256]', $checked[1][256]) => 'c',
@@ -291,7 +291,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                draw_checkbox('emailopts[8][256]', $checked[8][256]) => 'c',
                draw_checkbox('emailopts[16][256]', $checked[16][256]) => 'c',
        ));
-       
+
        $admin->row_multi_item(array(
                T('A new attachment is added') => 'l',
                draw_checkbox('emailopts[1][512]', $checked[1][512]) => 'c',
@@ -300,7 +300,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                draw_checkbox('emailopts[8][512]', $checked[8][512]) => 'c',
                draw_checkbox('emailopts[16][512]', $checked[16][512]) => 'c',
        ));
-       
+
        $admin->row_multi_item(array(
                T('Any other field changes') => 'l',
                draw_checkbox('emailopts[1][1024]', $checked[1][1024]) => 'c',
@@ -309,13 +309,13 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
                draw_checkbox('emailopts[8][1024]', $checked[8][1024]) => 'c',
                draw_checkbox('emailopts[16][1024]', $checked[16][1024]) => 'c',
        ));
-       
+
        // -------------------------------------------------------------------
        $admin->row_submit(null, ':save:', ':reset:', 6);
-       
+
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -324,10 +324,10 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add')
 if ($_REQUEST['do'] == 'search')
 {
        $fail = false;
-       
+
        NavLinks::usersAdd();
        $navigator->set_focus('link', 'users-pages-users', 'users-pages');
-       
+
        if (is_numeric($bugsys->in['userdata']))
        {
                $bugsys->input_clean('userdata', TYPE_UINT);
@@ -344,7 +344,7 @@ if ($_REQUEST['do'] == 'search')
        {
                $bugsys->in['userdata'] = str_replace('%', '\%', $bugsys->in['userdata']);
                $results = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . $bugsys->input_escape('userdata') . "%' OR displayname LIKE '%" . $bugsys->input_escape('userdata') . "%'");
-               
+
                if ($db->num_rows($results) < 1)
                {
                        $fail = true;
@@ -352,11 +352,11 @@ if ($_REQUEST['do'] == 'search')
                else
                {
                        $admin->page_start(T('Search Results'));
-                       
+
                        $admin->table_start();
                        $admin->table_head(T('Search Results'), 4);
                        $admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions')));
-                       
+
                        while ($row = $db->fetch_array($results))
                        {
                                $admin->row_multi_item(array(
@@ -366,13 +366,13 @@ if ($_REQUEST['do'] == 'search')
                                        '<a href="user.php?do=edit&amp;userid=' . $row['userid'] . '">[' . T('Edit') . ']</a>' => 'c'
                                ));
                        }
-                       
+
                        $admin->table_end();
-                       
+
                        $admin->page_end();
                }
        }
-       
+
        if ($fail)
        {
                $admin->error(T('Sorry, we could not find any users that matched your criteria.'));
@@ -385,20 +385,20 @@ if ($_REQUEST['do'] == 'showall')
 {
        NavLinks::usersAdd();
        $navigator->set_focus('link', 'users-showall', 'users');
-       
+
        LoadPaginationFramework();
        $pagination->setBitProcessor('AdminPageNavigatorBitCallback');
        $pagination->setNavigatorProcessor('AdminPageNavigatorCallback');
-       
+
        $admin->page_start(T('Show All Users'));
        $admin->table_start();
        $admin->table_head(T('Show All Users'), 4);
        $admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions')));
-       
+
        $count = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user");
        $pagination->setTotal($count['count']);
        $pagination->splitPages();
-       
+
        $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user ORDER BY userid ASC LIMIT " . $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage());
        while ($user = $db->fetch_array($users))
        {
@@ -409,11 +409,11 @@ if ($_REQUEST['do'] == 'showall')
                        '<a href="user.php?do=edit&amp;userid=' . $user['userid'] . '">[' . T('Edit') . ']</a>' => 'c'
                ));
        }
-       
+
        $admin->table_end();
-       
+
        $admin->page_code($pagination->constructPageNav('user.php?do=showall'));
-       
+
        $admin->page_end();
 }
 
@@ -423,20 +423,20 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::usersAdd();
        $navigator->set_focus('link', 'users-pages-users', 'users-pages');
-       
+
        $admin->page_start(T('User Search'));
-       
+
        $admin->form_start('user.php', 'search');
        $admin->table_start(true, '45%');
-       
+
        $admin->table_head(T('User Search'));
        $admin->row_input(T('Name/Email/ID'), 'userdata');
-       
+
        $admin->row_submit('', ':save:', '');
-       
+
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
index bbb43d2c63664958b3a5f9d987d768151c4ca3e6..10a2c6804985753570c83713b371b2d17410f837 100644 (file)
@@ -45,7 +45,7 @@ $permissions = array(
                'cansubscribe' => T('Can Subscribe to Bugs'),
                'canbeassignedto' => T('Can Be Assigned Bugs')
        ),
-       
+
        T('Posting/Submitting Permissions') => array(
                'canvote' => T('Can Vote on Polls'),
                'cansubmitbugs' => T('Can Submit Bugs'),
@@ -54,7 +54,7 @@ $permissions = array(
                'canputattach' => T('Can Upload/Edit Own Attachments'),
                'caneditattach' => T('Can Manage All Attachments')
        ),
-       
+
        T('Moderation/Managment Permissions') => array(
                'caneditown' => T('Can Edit Own Bugs'),
                'caneditother' => T('Can Edit Others\' Bugs'),
@@ -64,7 +64,7 @@ $permissions = array(
                'canchangestatus' => T('Can Change Status'),
                'candeletedata' => T('Can Delete Bugs and Comments')
        ),
-       
+
        T('Administrator Permissions') => array(
                'canadminpanel' => T('Can Access Control Panel'),
                'canadminbugs' => T('Can Administer Bug Reports'),
@@ -91,7 +91,7 @@ if ($_REQUEST['do'] == 'kill')
        $usergroup->set('usergroupid',  $bugsys->in['usergroupid']);
        $usergroup->set_condition();
        $usergroup->delete();
-       
+
        $admin->redirect('usergroup.php?do=modify');
 }
 
@@ -103,7 +103,7 @@ if ($_REQUEST['do'] == 'delete')
        {
                $admin->error(T('You can\'t delete a default usergroup.'));
        }
-       
+
        $admin->page_confirm(T('Are you sure you want to delete this usergroup? All users in this group will be set back to the default registered usergroup (id: 2).'), 'usergroup.php', 'kill', array('usergroupid' => $bugsys->in['usergroupid']));
 }
 
@@ -114,7 +114,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] ==
        $clone = ($_REQUEST['do'] == 'clone');
        $add = ($_REQUEST['do'] == 'add' OR $clone);
        $edit = !$add;
-       
+
        if ($edit)
        {
                NavLinks::usergroupsEdit($bugsys->in['usergroupid']);
@@ -125,18 +125,18 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] ==
                NavLinks::usergroupsAdd();
                $navigator->set_focus('link', 'usergroups-add', 'usergroups');
        }
-       
+
        $admin->page_start(($add ? T('New Usergroup') : T('Edit Usergroup')));
-       
+
        $admin->form_start('usergroup.php', ($add ? 'insert' : 'update'));
-       
+
        if ($edit OR $clone)
        {
                $usergroup = new UsergroupAPI($bugsys);
                $usergroup->set('usergroupid',  $bugsys->in['usergroupid']);
                $usergroup->set_condition();
                $usergroup->fetch();
-               
+
                if ($clone)
                {
                        $admin->form_hidden_field('cloneid', $usergroup->objdata['usergroupid']);
@@ -150,19 +150,19 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] ==
        {
                $usergroup['permissions'] = 319;
        }
-       
+
        // Details
        $admin->table_start();
        $admin->table_head(T('Usergroup Details'));
        $admin->row_input(T('Usergroup Title'), 'title', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['title'])));
        $admin->row_input(T('Display Title<div><dfn>This is the title that others will be able to see when comments are posted.</dfn></div>'), 'displaytitle', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['displaytitle'])));
        $admin->table_end();
-       
+
        // Permission
        $admin->table_start();
-               
+
        $admin->table_head(T('Permission Settings'));
-       
+
        foreach ($permissions AS $group => $settings)
        {
                $admin->row_span($group, 'thead', 'center');
@@ -171,13 +171,13 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] ==
                        $admin->row_yesno($name, "perm[$setting]", ($usergroup->objdata['permissions'] & $bugsys->permissions["$setting"]));
                }
        }
-       
+
        $admin->table_end();
-               
+
        // custom field permissions
        $admin->table_start();
        $admin->table_head(T('Custom Field Permissions'));
-       
+
        if ($edit OR $clone)
        {
                $perms = $db->query("SELECT fieldid, mask FROM " . TABLE_PREFIX . "bugfieldpermission WHERE usergroupid = " . $usergroup->objdata['usergroupid']);
@@ -186,7 +186,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] ==
                        $permissions["$perm[fieldid]"] = $perm['mask'];
                }
        }
-       
+
        $fields = $db->query("SELECT fieldid, name FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid");
        while ($field = $db->fetch_array($fields))
        {
@@ -196,16 +196,16 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] ==
                $admin->list_item(T('Can View, Edit Field'), 2, $permissions["$field[fieldid]"] == 2);
                $admin->row_list($field['name'], "custom[$field[fieldid]]");
        }
-       
+
        $admin->table_end();
-       
+
        // Submit
        $admin->table_start();
        $admin->row_submit();
        $admin->table_end();
-       
+
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -218,13 +218,13 @@ if ($_POST['do'] == 'insert')
        {
                $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch;
        }
-       
+
        $usergroup = new UsergroupAPI($bugsys);
        $usergroup->set('title',                $bugsys->in['title']);
        $usergroup->set('displaytitle', $bugsys->in['displaytitle']);
        $usergroup->set('permissions',  $permissionvalue);
        $usergroup->insert();
-       
+
        $bugsys->input_clean('custom', TYPE_UINT);
        if (is_array($bugsys->in['custom']))
        {
@@ -233,7 +233,7 @@ if ($_POST['do'] == 'insert')
                        $values[] = $usergroup->insertid . ", " . $bugsys->clean($fieldid, TYPE_UINT) . ", " . $mask;
                }
        }
-       
+
        if (is_array($values))
        {
                $db->query("
@@ -244,7 +244,7 @@ if ($_POST['do'] == 'insert')
                        )"
                );
        }
-       
+
        // copy product permissions from cloning
        if ($bugsys->input_clean('cloneid', TYPE_UINT))
        {
@@ -255,7 +255,7 @@ if ($_POST['do'] == 'insert')
                }
                build_permissions();
        }
-       
+
        $admin->redirect('usergroup.php?do=modify');
 }
 
@@ -273,7 +273,7 @@ if ($_POST['do'] == 'update')
        {
                $permissionvalue += $bugsys->permissions["$permtitle"] * $binaryswitch;
        }
-       
+
        $usergroup = new UsergroupAPI($bugsys);
        $usergroup->set('usergroupid',  $bugsys->in['usergroupid']);
        $usergroup->set_condition();
@@ -281,7 +281,7 @@ if ($_POST['do'] == 'update')
        $usergroup->set('displaytitle', $bugsys->in['displaytitle']);
        $usergroup->set('permissions',  $permissionvalue);
        $usergroup->update();
-       
+
        $bugsys->input_clean('custom', TYPE_UINT);
        if (is_array($bugsys->in['custom']))
        {
@@ -290,7 +290,7 @@ if ($_POST['do'] == 'update')
                        $values[] = $usergroup->values['usergroupid'] . ", " . $bugsys->clean($fieldid, TYPE_UINT) . ", " . $mask;
                }
        }
-       
+
        if (is_array($values))
        {
                $db->query("
@@ -301,7 +301,7 @@ if ($_POST['do'] == 'update')
                );
        }
 
-       
+
        $admin->redirect('usergroup.php?do=modify');
 }
 
@@ -310,7 +310,7 @@ if ($_POST['do'] == 'update')
 if ($_POST['do'] == 'doapprove')
 {
        $bugsys->input_clean('approve', TYPE_UINT);
-       
+
        $idlist = array();
        if (is_array($bugsys->in['approve']))
        {
@@ -322,13 +322,13 @@ if ($_POST['do'] == 'doapprove')
                        }
                }
        }
-       
+
        // load the template system...
        $bugsys->load('template_fs', 'template', true);
        $template->setExtension('tpl');
        $template->setTemplateDir('templates/');
        $template->setDatabaseCache(TABLE_PREFIX . 'template');
-       
+
        if (sizeof($idlist) > 0)
        {
                $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid IN (" . implode(',', $idlist) . ")");
@@ -341,10 +341,10 @@ if ($_POST['do'] == 'doapprove')
                        $mail->setBodyText($email['email']['bodyText']['value']);
                        $mail->send($user['email'], $user['displayname']);
                }
-               
+
                $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE userid IN (" . implode(',', $idlist) . ")");
        }
-       
+
        $admin->redirect('usergroup.php', T('The selected users have been promoted to the "Registered" usergroup.'));
 }
 
@@ -354,29 +354,29 @@ if ($_REQUEST['do'] == 'approve')
 {
        NavLinks::usergroupsAdd();
        $navigator->set_focus('link', 'usergroups-approve', 'usergroups');
-       
+
        $admin->page_start(T('Moderate Awaiting Users'), 3);
-       
+
        $admin->form_start('usergroup.php', 'doapprove');
        $admin->table_start();
        $admin->table_head(T('Moderate Un-Approved Users'), 3);
-       
+
        $admin->table_column_head(array(T('Display Name'), T('Usergroup'), T('Approve')));
-       
+
        $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE usergroupid IN (3, 4)");
        while ($user = $db->fetch_array($users))
        {
                $admin->row_multi_item(array(
                        '<a href="user.php?do=edit&amp;userid=' . $user['userid'] . '">' . $user['email'] . '</a>' => 'l',
                        bugdar::$datastore['usergroup']["$user[usergroupid]"]['title'] => 'c',
-                       '<input name="approve[' . $user['userid'] . ']" type="checkbox" value="1" />' => 'c'                    
+                       '<input name="approve[' . $user['userid'] . ']" type="checkbox" value="1" />' => 'c'
                ));
        }
-       
+
        $admin->row_submit(false, ':save:', ':reset:', 3);
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -386,20 +386,20 @@ if ($_REQUEST['do'] == 'modify')
 {
        NavLinks::usergroupsAdd();
        $navigator->set_focus('link', 'users-pages-usergroups', 'users-pages');
-       
+
        $admin->page_start(T('Usergroup Manager'));
-       
+
        $admin->form_start('usergroup.php', 'null');
        $admin->table_start();
        $admin->table_head(T('Usergroup Manager'), 3, 'usergroups');
-       
+
        $groups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid ASC");
        while ($group = $db->fetch_array($groups))
        {
                $usergroups["$group[usergroupid]"] = $group;
        }
        $db->free_result($groups);
-       
+
        $groups = $db->query("
                SELECT COUNT(user.userid) AS total, user.usergroupid
                FROM " . TABLE_PREFIX . "user AS user
@@ -411,7 +411,7 @@ if ($_REQUEST['do'] == 'modify')
        {
                $usergroups["$group[usergroupid]"]['total'] = $group['total'];
        }
-       
+
        $admin->table_column_head(array(T('Usergroup'), T('Number of Users'), T('Action')));
        foreach ($usergroups AS $group)
        {
@@ -424,10 +424,10 @@ if ($_REQUEST['do'] == 'modify')
                        ($group['usergroupid'] > 6 ? " <a href=\"usergroup.php?do=delete&amp;usergroupid=$group[usergroupid]\">[" . T('Delete') . "]</a>" : '') => 'c'
                ));
        }
-       
+
        $admin->table_end();
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
index b01abe000cfc2cf0629fc4e74d7bf12a82e2631c..9d75bc717b5ccb7d2c848cacc4bcdde5b913efc9 100644 (file)
@@ -49,9 +49,9 @@ if ($_REQUEST['do'] == 'kill')
        $help = new UserHelpAPI($bugsys);
        $help->set('keystring', $bugsys->in['keystring']);
        $help->delete();
-       
+
        build_user_help();
-       
+
        $admin->redirect('userhelp.php?do=modify');
 }
 
@@ -71,7 +71,7 @@ if ($_POST['do'] == 'insert')
        $help->set('title',             $bugsys->in['title']);
        $help->set('body',              $bugsys->in['body']);
        $help->insert();
-       
+
        $admin->redirect('userhelp.php?do=modify');
 }
 
@@ -80,24 +80,24 @@ if ($_POST['do'] == 'insert')
 if ($_REQUEST['do'] == 'add')
 {
        $navigator->set_focus('link', 'options-userhelp-add', 'options-userhelp');
-       
+
        $admin->page_start(T('New Help Text'));
-       
+
        $admin->form_start('userhelp.php', 'insert');
-       
+
        $admin->table_start();
        $admin->table_head(T('New Help Text'));
-       
+
        $admin->row_input(T('Topic Title'), 'title');
        $admin->row_input(T('Unique Key<br />(lowercase letters, underscores, and numbers only)'), 'keystring');
        $admin->row_textarea(T('Body Text'), 'body');
-       
+
        $admin->row_submit();
-       
+
        $admin->table_end();
-       
+
        $admin->form_end();
-       
+
        $admin->page_end();
 }
 
@@ -117,7 +117,7 @@ if ($_POST['do'] == 'update')
        }
 
        build_user_help();
-       
+
        $admin->redirect('userhelp.php?do=modify');
 }
 
@@ -126,26 +126,26 @@ if ($_POST['do'] == 'update')
 if ($_REQUEST['do'] == 'modify')
 {
        $navigator->set_focus('link', 'options-pages-userhelp', 'options-pages');
-       
+
        $admin->page_start(T('Edit User Help'));
-       
+
        $admin->form_start('userhelp.php', 'update');
-       
+
        $admin->table_start();
        $admin->table_head(T('Edit User Help'));
-       
+
        $topics = $db->query("SELECT * FROM " . TABLE_PREFIX . "fieldhelp ORDER BY keystring ASC");
        while ($topic = $db->fetch_array($topics))
        {
                $inputfield = '<input type="text" class="input" name="help[' . $topic['keystring'] . '][title]" value="' . $topic['title'] . '" size="35" />';
                $delete = (!in_array($topic['keystring'], UserHelpAPI::not_able_to_delete()) ? '<br /><br /><a href="userhelp.php?do=delete&amp;keystring=' . $topic['keystring'] . '">[' . T('Delete') . ']</a>' : '');
-               
+
                $admin->row_textarea($inputfield . '<br /><em>' . $topic['keystring'] . '</em>' . $delete, 'help[' . $topic['keystring'] . '][body]', $topic['body']);
        }
-       
+
        $admin->row_submit();
        $admin->table_end();
-       
+
        $admin->page_end();
 }
 
index 0b851e7a9a247a09ed6c949cc04781e9ff18bf5f..4b0e94deaabdf3421f1349e7787c54eb7c3d7545 100644 (file)
@@ -66,19 +66,19 @@ if ($_POST['do'] == 'insert')
 {
        $attachapi = new AttachmentAPI($bugsys);
        $attachapi->set('bugid',        $bugsys->in['bugid']);
-       
+
        if (!can_perform('canputattach', $bug['product']))
        {
                $message->errorPermission();
        }
-       
+
        // max packet size
        $var = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'");
        $bugsys->debug("max_allowed_packet = $var[Value]");
-       
+
        // create alias
        $FILE =& $_FILES['attachment'];
-       
+
        // PHP errors
        switch ($FILE['error'])
        {
@@ -89,52 +89,52 @@ if ($_POST['do'] == 'insert')
                case 4: $message->addError(T('The file was not uploaded at all.')); break;
                case 6: $message->addError(T('PHP could not find the /tmp directory.')); break;
        }
-       
+
        // did it upload?
        if (!is_uploaded_file($FILE['tmp_name']))
        {
                $message->addError(T('The file you specified did not upload.'));
        }
-       
+
        // TODO - put some MIME-type validation here
-       
+
        if (filesize($FILE['tmp_name']) > $var['Value'])
        {
                $message->addError(T('The file you specified exceeds MySQL\'s maximum allowed packet.'));
        }
-       
+
        $attachapi->set('attachment',   file_get_contents($FILE['tmp_name']));
        $attachapi->set('filename',             $FILE['name']);
        $attachapi->set('mimetype',             $FILE['type']);
        $attachapi->set('filesize',             $FILE['size']);
        $attachapi->set('description',  $bugsys->in['description']);
        $attachapi->set('userid',               $bugsys->userinfo['userid']);
-               
+
        // insert an attachment
        if (!$message->hasErrors())
        {
                $attachapi->insert();
-               
+
                $obsoletes = $bugsys->input_clean('obsoletes', TYPE_UINT);
-               
+
                $notif->send_new_attachment_notice($attachapi->values, $obsoletes, $attachapi->insertid);
-               
+
                // mark obsoletes
                if (is_array($obsoletes) AND sizeof($obsoletes) > 0)
                {
                        $db->query("UPDATE " . TABLE_PREFIX . "attachment SET obsolete = 1 WHERE attachmentid IN (" . implode(',', $obsoletes) . ") AND !obsolete AND bugid = $bug[bugid]");
-                       
+
                        foreach ($obsoletes AS $attachmentid)
                        {
                                $log = new Logging;
                                $log->set_bugid($bug['bugid']);
                                $log->set_attachmentid($attachmentid);
                                $log->add_data(true, array('obsolete' => 0), array('obsolete'), false, 'attachment');
-                               $log->add_data(false, array('obsolete' => 1), array('obsolete'), false, 'attachment'); 
+                               $log->add_data(false, array('obsolete' => 1), array('obsolete'), false, 'attachment');
                                $log->update_history();
                        }
                }
-               
+
                // handle comment stuff
                if (can_perform('canpostcomments', $bug['product']) AND trim($bugsys->in['comment']))
                {
@@ -144,15 +144,15 @@ if ($_POST['do'] == 'insert')
                        $comment->set('comment',        $bugsys->in['comment']);
                        $comment->set('dateline',       $attachapi->values['dateline']);
                        $comment->insert();
-                       
+
                        $notif->send_new_comment_notice($comment->values);
                }
-               
+
                // update the last post data
                $db->query("UPDATE " . TABLE_PREFIX . "bug SET lastposttime = " . $attachapi->values['dateline'] . ", hiddenlastposttime = " . $attachapi->values['dateline'] . ", lastpostby = " . $bugsys->userinfo['userid'] . ", hiddenlastpostby = " . $bugsys->userinfo['userid'] . " WHERE bugid = $bug[bugid]");
-               
+
                $notif->finalize();
-               
+
                $message->redirect(T('The attachment has been added to the bug.'), "showreport.php?bugid=$bug[bugid]");
        }
        else
@@ -170,12 +170,12 @@ if ($_REQUEST['do'] == 'add')
        {
                $message->errorPermission();
        }
-       
+
        $MAXFILESIZE = $funct->fetch_max_attachment_size();
-       
+
        $show['addcomment'] = ((can_perform('canpostcomments', $bug['product'])) ? true : false);
        $show['obsoletes'] = false;
-       
+
        $obsoletes_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE bugid = $bug[bugid] AND !obsolete");
        $obsoletes = '';
        while ($obsolete = $db->fetch_array($obsoletes_fetch))
@@ -183,7 +183,7 @@ if ($_REQUEST['do'] == 'add')
                $show['obsoletes'] = true;
                $obsoletes .= "<div><input name=\"obsoletes[]\" type=\"checkbox\" value=\"$obsolete[attachmentid]\"" . (is_array($bugsys->in['obsoletes']) AND in_array($obsolete['attachmentid'], $bugsys->in['obsoletes']) ? ' checked="checked"' : '') . " /> $obsolete[filename]" . ($obsolete['description'] ? " [$obsolete[description]]" : '') . "</div>\n";
        }
-       
+
        eval('$template->flush("' . $template->fetch('newattach') . '");');
 }
 
@@ -195,21 +195,21 @@ if ($_POST['do'] == 'update')
        {
                $message->errorPermission();
        }
-       
+
        $attachapi = new AttachmentAPI($bugsys);
        $attachapi->set('attachmentid', $bugsys->in['attachmentid']);
        $attachapi->dorelations = array();
        $attachapi->set_condition();
-       
+
        if ($bugsys->in['__delete__'] != '')
        {
                if (!(can_perform('caneditattach', $bug['product']) AND can_perform('candeletedata', $bug['productid'])))
                {
                        $message->errorPermission();
                }
-               
+
                $attachapi->delete();
-               
+
                $message->redirect(T('The attachment was successfully deleted.'), "showreport.php?bugid=$bug[bugid]");
        }
        else
@@ -217,19 +217,19 @@ if ($_POST['do'] == 'update')
                $log = new Logging;
                $log->set_bugid($bug['bugid']);
                $log->set_attachmentid($bugsys->in['attachmentid']);
-               
+
                $attachapi->fetch();
-               
+
                $log->add_data(true, $attachapi->objdata, array('attachment'), true, 'attachment');
-               
+
                $attachapi->set('description',  $bugsys->in['description']);
                $attachapi->set('obsolete',             $bugsys->in['obsolete']);
                $attachapi->update();
-               
+
                $log->add_data(false, $attachapi->values, array('attachment'), true, 'attachment');
-               
+
                $log->update_history();
-               
+
                $message->redirect(T('The attachment was successfully modified.'), "showreport.php?bugid=$bug[bugid]");
        }
 }
@@ -242,9 +242,9 @@ if ($_REQUEST['do'] == 'edit')
        {
                $message->errorPermission();
        }
-       
+
        $show['delete'] = (can_perform('caneditattach', $bug['product']) AND can_perform('candeletedata', $bug['productid']));
-       
+
        eval('$template->flush("' . $template->fetch('editattach') . '");');
 }
 
index 738316bf6a815e147475a1063263760d1fbf395b..a49a8ec6d0d1fdbf3f710369ec8d4841f9391386 100644 (file)
@@ -14,27 +14,27 @@ $THELIST = array(
                'table' => 'usergroup',
                'rebuild' => 'build_usergroups'
        ),
-       
+
        'statuses' => array(
                'table' => 'status',
                'rebuild' => 'build_statuses'
        ),
-       
+
        'severity' => array(
                'table' => 'severity',
                'rebuild' => 'build_severities'
        ),
-       
+
        'priorities' => array(
                'table' => 'priority',
                'rebuild' => 'build_priorities'
        ),
-       
+
        'resolutions' => array(
                'table' => 'resolution',
                'rebuild' => 'build_resolutions'
        ),
-       
+
        'user help' => array(
                'table' => 'fieldhelp',
                'rebuild' => 'build_user_help',
@@ -68,19 +68,19 @@ if ($_REQUEST['do'] == 'export')
                        $exportlist["$display"][] = $fitem;
                }
                $db->free_result($fetch);
-               
+
                echo "Exported $display\n";
        }
-       
+
        $phpfile = '<?' . 'php
 
 // stores exported data data
 // SVN $' . 'Id: $
 
-$DATASTORE = "' . addslashes(serialize($exportlist)) . '"; 
+$DATASTORE = "' . addslashes(serialize($exportlist)) . '";
 
 ?' . '>';
-       
+
        if ($handle = fopen('./docs/datatools_store.php', 'w'))
        {
                if (fwrite($handle, $phpfile))
@@ -99,7 +99,7 @@ $DATASTORE = "' . addslashes(serialize($exportlist)) . '";
                echo 'Could not open the file with mode "w"';
                exit;
        }
-       
+
        echo "Wrote the file\n";
 }
 
@@ -109,11 +109,11 @@ if ($_REQUEST['do'] == 'import')
 {
        require('./docs/datatools_store.php');
        $DATASTORE = unserialize(stripslashes($DATASTORE));
-       
+
        foreach ($THELIST AS $display => $data)
        {
                $db->query("TRUNCATE TABLE " . TABLE_PREFIX . "$data[table]");
-               
+
                $fields = array();
                $values = array();
                foreach ($DATASTORE["$display"] AS $mainarray)
@@ -128,7 +128,7 @@ if ($_REQUEST['do'] == 'import')
                        echo str_replace(array('>', '<'), array('&gt;', '&lt;'), $query) . "\n";
                        $db->query($query);
                }
-               
+
                $data['rebuild']();
                echo "Rebuilding $data[table]\n\n";
        }
@@ -140,9 +140,9 @@ if ($_REQUEST['do'] == 'view')
 {
        require_once('./docs/datatools_store.php');
        $DATASTORE = unserialize(stripslashes($DATASTORE));
-       
+
        $build = '$data = array(';
-       
+
        foreach ($THELIST AS $display => $data)
        {
                $build .= "\n\t'$data[table]' => array(";
@@ -160,9 +160,9 @@ if ($_REQUEST['do'] == 'view')
                $build .= "\n\t),";
        }
        $build = substr($build, 0, strlen($build) - 1);
-       
+
        $build .= "\n);";
-       
+
        echo '<textarea style="height: 500px; width: 100%">' . htmlspecialchars($build) . '</textarea>';
 }
 
@@ -196,13 +196,13 @@ if ($_REQUEST['do'] == 'settings')
 
 \$settings = array(
 FILE;
-       
+
        $settings = $db->query("SELECT * FROM " . TABLE_PREFIX . "setting");
        while ($setting = $db->fetch_array($settings))
        {
                $fout .= "\n\t'$setting[varname]' => '" . str_replace("'", "\'", $setting['value']) . "',";
        }
-       
+
        $fout .= <<<FILE
 
 );
@@ -215,10 +215,10 @@ FILE;
 \*=====================================================================*/
 ?>
 FILE;
-       
+
        file_put_contents('install/settings.php', $fout);
        chmod('install/settings.php', 0777);
-       
+
        echo 'Dumping current settings into install/settings.php';
 }
 
index 4bb738e5d4a9271f4af39667435b1b6ffe6cf044..ef3be402fdf157ad07a2c10aecdd34e9bf28d003 100644 (file)
@@ -3,8 +3,8 @@
 // stores exported data data
 // SVN $Id$
 
-$DATASTORE = "a:6:{s:10:\"usergroups\";a:6:{i:0;a:4:{s:11:\"usergroupid\";s:1:\"1\";s:5:\"title\";s:26:\"Unregistered/Not Logged In\";s:12:\"displaytitle\";s:5:\"Guest\";s:11:\"permissions\";s:2:\"83\";}i:1;a:4:{s:11:\"usergroupid\";s:1:\"2\";s:5:\"title\";s:16:\"Registered Users\";s:12:\"displaytitle\";s:10:\"Registered\";s:11:\"permissions\";s:8:\"33554687\";}i:2;a:4:{s:11:\"usergroupid\";s:1:\"3\";s:5:\"title\";s:27:\"Awaiting Email Confirmation\";s:12:\"displaytitle\";s:18:\"Pending Activation\";s:11:\"permissions\";s:1:\"7\";}i:3;a:4:{s:11:\"usergroupid\";s:1:\"4\";s:5:\"title\";s:16:\"Pending Approval\";s:12:\"displaytitle\";s:15:\"Account Pending\";s:11:\"permissions\";s:1:\"3\";}i:4;a:4:{s:11:\"usergroupid\";s:1:\"5\";s:5:\"title\";s:10:\"Developers\";s:12:\"displaytitle\";s:9:\"Developer\";s:11:\"permissions\";s:8:\"49291263\";}i:5;a:4:{s:11:\"usergroupid\";s:1:\"6\";s:5:\"title\";s:14:\"Administrators\";s:12:\"displaytitle\";s:13:\"Administrator\";s:11:\"permissions\";s:8:\"67108863\";}}s:8:\"statuses\";a:5:{i:0;a:4:{s:8:\"statusid\";s:1:\"1\";s:6:\"status\";s:11:\"Unconfirmed\";s:12:\"displayorder\";s:1:\"1\";s:5:\"color\";s:7:\"#D96640\";}i:1;a:4:{s:8:\"statusid\";s:1:\"2\";s:6:\"status\";s:9:\"Confirmed\";s:12:\"displayorder\";s:1:\"2\";s:5:\"color\";s:7:\"#FFFF40\";}i:2;a:4:{s:8:\"statusid\";s:1:\"3\";s:6:\"status\";s:8:\"Assigned\";s:12:\"displayorder\";s:1:\"3\";s:5:\"color\";s:7:\"#B266D9\";}i:3;a:4:{s:8:\"statusid\";s:1:\"4\";s:6:\"status\";s:6:\"Closed\";s:12:\"displayorder\";s:1:\"4\";s:5:\"color\";s:7:\"#8CD940\";}i:4;a:4:{s:8:\"statusid\";s:1:\"5\";s:6:\"status\";s:8:\"Reopened\";s:12:\"displayorder\";s:1:\"5\";s:5:\"color\";s:7:\"#40D9FF\";}}s:8:\"severity\";a:6:{i:0;a:3:{s:10:\"severityid\";s:1:\"1\";s:8:\"severity\";s:11:\"Enhancement\";s:12:\"displayorder\";s:1:\"1\";}i:1;a:3:{s:10:\"severityid\";s:1:\"2\";s:8:\"severity\";s:7:\"Trivial\";s:12:\"displayorder\";s:1:\"2\";}i:2;a:3:{s:10:\"severityid\";s:1:\"3\";s:8:\"severity\";s:5:\"Minor\";s:12:\"displayorder\";s:1:\"3\";}i:3;a:3:{s:10:\"severityid\";s:1:\"4\";s:8:\"severity\";s:8:\"Moderate\";s:12:\"displayorder\";s:1:\"4\";}i:4;a:3:{s:10:\"severityid\";s:1:\"5\";s:8:\"severity\";s:5:\"Major\";s:12:\"displayorder\";s:1:\"5\";}i:5;a:3:{s:10:\"severityid\";s:1:\"6\";s:8:\"severity\";s:8:\"Critical\";s:12:\"displayorder\";s:1:\"6\";}}s:10:\"priorities\";a:5:{i:0;a:3:{s:10:\"priorityid\";s:1:\"1\";s:8:\"priority\";s:8:\"Deferred\";s:12:\"displayorder\";s:1:\"1\";}i:1;a:3:{s:10:\"priorityid\";s:1:\"2\";s:8:\"priority\";s:3:\"Low\";s:12:\"displayorder\";s:1:\"2\";}i:2;a:3:{s:10:\"priorityid\";s:1:\"3\";s:8:\"priority\";s:6:\"Normal\";s:12:\"displayorder\";s:1:\"3\";}i:3;a:3:{s:10:\"priorityid\";s:1:\"4\";s:8:\"priority\";s:4:\"High\";s:12:\"displayorder\";s:1:\"4\";}i:4;a:3:{s:10:\"priorityid\";s:1:\"5\";s:8:\"priority\";s:11:\"Address Now\";s:12:\"displayorder\";s:1:\"5\";}}s:11:\"resolutions\";a:6:{i:0;a:3:{s:12:\"resolutionid\";s:1:\"1\";s:10:\"resolution\";s:4:\"Open\";s:12:\"displayorder\";s:1:\"1\";}i:1;a:3:{s:12:\"resolutionid\";s:1:\"2\";s:10:\"resolution\";s:5:\"Fixed\";s:12:\"displayorder\";s:1:\"2\";}i:2;a:3:{s:12:\"resolutionid\";s:1:\"3\";s:10:\"resolution\";s:5:\"Bogus\";s:12:\"displayorder\";s:1:\"3\";}i:3;a:3:{s:12:\"resolutionid\";s:1:\"4\";s:10:\"resolution\";s:9:\"Duplicate\";s:12:\"displayorder\";s:1:\"4\";}i:4;a:3:{s:12:\"resolutionid\";s:1:\"5\";s:10:\"resolution\";s:9:\"Won\'t Fix\";s:12:\"displayorder\";s:1:\"5\";}i:5;a:3:{s:12:\"resolutionid\";s:1:\"6\";s:10:\"resolution\";s:12:\"Works for Me\";s:12:\"displayorder\";s:1:\"6\";}}s:9:\"user help\";a:14:{i:0;a:3:{s:9:\"keystring\";s:5:\"bugid\";s:5:\"title\";s:15:\"Bug ID & Hidden\";s:4:\"body\";s:358:\"The bug ID is a unique identification number that can be used to to quickly locate it. The ID is also used for duplicates and dependencies. Marking a bug as &quot;hidden&quot; will prevent all users who cannot see hidden bugs (see the Bugdar manual regarding permissions). Hiding is useful for critical security issues that you do not want to be made public.\";}i:1;a:3:{s:9:\"keystring\";s:7:\"summary\";s:5:\"title\";s:7:\"Summary\";s:4:\"body\";s:108:\"The bug summary is used to give an overall description of the problem. It is displayed on all listing pages.\";}i:2;a:3:{s:9:\"keystring\";s:8:\"reporter\";s:5:\"title\";s:8:\"Reporter\";s:4:\"body\";s:139:\"The reporter is the user who is responsible for the initial bug report. If you need to get follow-up information, you should ask this user.\";}i:3;a:3:{s:9:\"keystring\";s:8:\"dateline\";s:5:\"title\";s:11:\"Report Time\";s:4:\"body\";s:63:\"The report time is the date and time of the initial bug report.\";}i:4;a:3:{s:9:\"keystring\";s:7:\"product\";s:5:\"title\";s:15:\"Product/Version\";s:4:\"body\";s:252:\"The product, component, and version show the general area where the problem occurs. Products are broad--for instance a car--whereas components would be like a door, using our car analogy. Versions show the specific revision at which the problem occurs.\";}i:5;a:3:{s:9:\"keystring\";s:10:\"assignedto\";s:5:\"title\";s:10:\"Assignment\";s:4:\"body\";s:103:\"The person who the bug is assigned to (if anybody) is the developer who is charged with fixing the bug.\";}i:6;a:3:{s:9:\"keystring\";s:6:\"status\";s:5:\"title\";s:6:\"Status\";s:4:\"body\";s:83:\"Status describes the state of the bug and how it is being handled, if it is at all.\";}i:7;a:3:{s:9:\"keystring\";s:10:\"resolution\";s:5:\"title\";s:10:\"Resolution\";s:4:\"body\";s:140:\"The resolution is the explanation for the status. Usually the resolution is set when a bug is marked &quot;Closed&quot; in the status field.\";}i:8;a:3:{s:9:\"keystring\";s:8:\"severity\";s:5:\"title\";s:8:\"Severity\";s:4:\"body\";s:145:\"Severity is the degree of the problem. This allows differentiation between a critical security flaw versus a slight annoyance with a work-around.\";}i:9;a:3:{s:9:\"keystring\";s:8:\"priority\";s:5:\"title\";s:8:\"Priority\";s:4:\"body\";s:221:\"The priority shows the degree of celerity with which the bug will be fixed. This is different from severity in that, a bug could be a valid issue, but it could be for an old version and thus the priority wouldn\'t be high.\";}i:10;a:3:{s:9:\"keystring\";s:11:\"duplicateof\";s:5:\"title\";s:12:\"Duplicate Of\";s:4:\"body\";s:107:\"If a bug is the same as another one in the bug tracker, you can enter the bug ID of that bug in this field.\";}i:11;a:3:{s:9:\"keystring\";s:10:\"dependency\";s:5:\"title\";s:12:\"Dependencies\";s:4:\"body\";s:177:\"If a bug is affected by another bug, you can enter the ID of the bug that affects this bug here. You can enter multiple values into this field by separating the IDs with spaces.\";}i:12;a:3:{s:9:\"keystring\";s:8:\"newreply\";s:5:\"title\";s:9:\"New Reply\";s:4:\"body\";s:557:\"Here you can specify additional comments. If you do not change any fields, this will merely attach a comment.\r
-\r
-The &quot;Automation&quot; drop-down next to this box (which may be hidden) will allow you to perform a common task. These administrator-defined tasks can change any of the bug fields automatically and then add an automatic reply. If you change a field that will be altered by the action, the action\'s change will take precedence. Also, if you enter a comment and the action specifies a comment, the automatic comment will be attached to yours.\";}i:13;a:3:{s:9:\"keystring\";s:11:\"columnorder\";s:5:\"title\";s:22:\"Custom Column Ordering\";s:4:\"body\";s:351:\"You can change the ordering and display of columns on the bug list using these settings. Any column with a position value of &quot;0&quot; will not be displayed in the list. Columns are positioned in the grid with the lowest numbered column starting at the far-left. If columns share a position number, they will be placed in the same column position.\";}}}"; 
+$DATASTORE = "a:6:{s:10:\"usergroups\";a:6:{i:0;a:4:{s:11:\"usergroupid\";s:1:\"1\";s:5:\"title\";s:26:\"Unregistered/Not Logged In\";s:12:\"displaytitle\";s:5:\"Guest\";s:11:\"permissions\";s:2:\"83\";}i:1;a:4:{s:11:\"usergroupid\";s:1:\"2\";s:5:\"title\";s:16:\"Registered Users\";s:12:\"displaytitle\";s:10:\"Registered\";s:11:\"permissions\";s:8:\"33554687\";}i:2;a:4:{s:11:\"usergroupid\";s:1:\"3\";s:5:\"title\";s:27:\"Awaiting Email Confirmation\";s:12:\"displaytitle\";s:18:\"Pending Activation\";s:11:\"permissions\";s:1:\"7\";}i:3;a:4:{s:11:\"usergroupid\";s:1:\"4\";s:5:\"title\";s:16:\"Pending Approval\";s:12:\"displaytitle\";s:15:\"Account Pending\";s:11:\"permissions\";s:1:\"3\";}i:4;a:4:{s:11:\"usergroupid\";s:1:\"5\";s:5:\"title\";s:10:\"Developers\";s:12:\"displaytitle\";s:9:\"Developer\";s:11:\"permissions\";s:8:\"49291263\";}i:5;a:4:{s:11:\"usergroupid\";s:1:\"6\";s:5:\"title\";s:14:\"Administrators\";s:12:\"displaytitle\";s:13:\"Administrator\";s:11:\"permissions\";s:8:\"67108863\";}}s:8:\"statuses\";a:5:{i:0;a:4:{s:8:\"statusid\";s:1:\"1\";s:6:\"status\";s:11:\"Unconfirmed\";s:12:\"displayorder\";s:1:\"1\";s:5:\"color\";s:7:\"#D96640\";}i:1;a:4:{s:8:\"statusid\";s:1:\"2\";s:6:\"status\";s:9:\"Confirmed\";s:12:\"displayorder\";s:1:\"2\";s:5:\"color\";s:7:\"#FFFF40\";}i:2;a:4:{s:8:\"statusid\";s:1:\"3\";s:6:\"status\";s:8:\"Assigned\";s:12:\"displayorder\";s:1:\"3\";s:5:\"color\";s:7:\"#B266D9\";}i:3;a:4:{s:8:\"statusid\";s:1:\"4\";s:6:\"status\";s:6:\"Closed\";s:12:\"displayorder\";s:1:\"4\";s:5:\"color\";s:7:\"#8CD940\";}i:4;a:4:{s:8:\"statusid\";s:1:\"5\";s:6:\"status\";s:8:\"Reopened\";s:12:\"displayorder\";s:1:\"5\";s:5:\"color\";s:7:\"#40D9FF\";}}s:8:\"severity\";a:6:{i:0;a:3:{s:10:\"severityid\";s:1:\"1\";s:8:\"severity\";s:11:\"Enhancement\";s:12:\"displayorder\";s:1:\"1\";}i:1;a:3:{s:10:\"severityid\";s:1:\"2\";s:8:\"severity\";s:7:\"Trivial\";s:12:\"displayorder\";s:1:\"2\";}i:2;a:3:{s:10:\"severityid\";s:1:\"3\";s:8:\"severity\";s:5:\"Minor\";s:12:\"displayorder\";s:1:\"3\";}i:3;a:3:{s:10:\"severityid\";s:1:\"4\";s:8:\"severity\";s:8:\"Moderate\";s:12:\"displayorder\";s:1:\"4\";}i:4;a:3:{s:10:\"severityid\";s:1:\"5\";s:8:\"severity\";s:5:\"Major\";s:12:\"displayorder\";s:1:\"5\";}i:5;a:3:{s:10:\"severityid\";s:1:\"6\";s:8:\"severity\";s:8:\"Critical\";s:12:\"displayorder\";s:1:\"6\";}}s:10:\"priorities\";a:5:{i:0;a:3:{s:10:\"priorityid\";s:1:\"1\";s:8:\"priority\";s:8:\"Deferred\";s:12:\"displayorder\";s:1:\"1\";}i:1;a:3:{s:10:\"priorityid\";s:1:\"2\";s:8:\"priority\";s:3:\"Low\";s:12:\"displayorder\";s:1:\"2\";}i:2;a:3:{s:10:\"priorityid\";s:1:\"3\";s:8:\"priority\";s:6:\"Normal\";s:12:\"displayorder\";s:1:\"3\";}i:3;a:3:{s:10:\"priorityid\";s:1:\"4\";s:8:\"priority\";s:4:\"High\";s:12:\"displayorder\";s:1:\"4\";}i:4;a:3:{s:10:\"priorityid\";s:1:\"5\";s:8:\"priority\";s:11:\"Address Now\";s:12:\"displayorder\";s:1:\"5\";}}s:11:\"resolutions\";a:6:{i:0;a:3:{s:12:\"resolutionid\";s:1:\"1\";s:10:\"resolution\";s:4:\"Open\";s:12:\"displayorder\";s:1:\"1\";}i:1;a:3:{s:12:\"resolutionid\";s:1:\"2\";s:10:\"resolution\";s:5:\"Fixed\";s:12:\"displayorder\";s:1:\"2\";}i:2;a:3:{s:12:\"resolutionid\";s:1:\"3\";s:10:\"resolution\";s:5:\"Bogus\";s:12:\"displayorder\";s:1:\"3\";}i:3;a:3:{s:12:\"resolutionid\";s:1:\"4\";s:10:\"resolution\";s:9:\"Duplicate\";s:12:\"displayorder\";s:1:\"4\";}i:4;a:3:{s:12:\"resolutionid\";s:1:\"5\";s:10:\"resolution\";s:9:\"Won\'t Fix\";s:12:\"displayorder\";s:1:\"5\";}i:5;a:3:{s:12:\"resolutionid\";s:1:\"6\";s:10:\"resolution\";s:12:\"Works for Me\";s:12:\"displayorder\";s:1:\"6\";}}s:9:\"user help\";a:14:{i:0;a:3:{s:9:\"keystring\";s:5:\"bugid\";s:5:\"title\";s:15:\"Bug ID & Hidden\";s:4:\"body\";s:358:\"The bug ID is a unique identification number that can be used to to quickly locate it. The ID is also used for duplicates and dependencies. Marking a bug as &quot;hidden&quot; will prevent all users who cannot see hidden bugs (see the Bugdar manual regarding permissions). Hiding is useful for critical security issues that you do not want to be made public.\";}i:1;a:3:{s:9:\"keystring\";s:7:\"summary\";s:5:\"title\";s:7:\"Summary\";s:4:\"body\";s:108:\"The bug summary is used to give an overall description of the problem. It is displayed on all listing pages.\";}i:2;a:3:{s:9:\"keystring\";s:8:\"reporter\";s:5:\"title\";s:8:\"Reporter\";s:4:\"body\";s:139:\"The reporter is the user who is responsible for the initial bug report. If you need to get follow-up information, you should ask this user.\";}i:3;a:3:{s:9:\"keystring\";s:8:\"dateline\";s:5:\"title\";s:11:\"Report Time\";s:4:\"body\";s:63:\"The report time is the date and time of the initial bug report.\";}i:4;a:3:{s:9:\"keystring\";s:7:\"product\";s:5:\"title\";s:15:\"Product/Version\";s:4:\"body\";s:252:\"The product, component, and version show the general area where the problem occurs. Products are broad--for instance a car--whereas components would be like a door, using our car analogy. Versions show the specific revision at which the problem occurs.\";}i:5;a:3:{s:9:\"keystring\";s:10:\"assignedto\";s:5:\"title\";s:10:\"Assignment\";s:4:\"body\";s:103:\"The person who the bug is assigned to (if anybody) is the developer who is charged with fixing the bug.\";}i:6;a:3:{s:9:\"keystring\";s:6:\"status\";s:5:\"title\";s:6:\"Status\";s:4:\"body\";s:83:\"Status describes the state of the bug and how it is being handled, if it is at all.\";}i:7;a:3:{s:9:\"keystring\";s:10:\"resolution\";s:5:\"title\";s:10:\"Resolution\";s:4:\"body\";s:140:\"The resolution is the explanation for the status. Usually the resolution is set when a bug is marked &quot;Closed&quot; in the status field.\";}i:8;a:3:{s:9:\"keystring\";s:8:\"severity\";s:5:\"title\";s:8:\"Severity\";s:4:\"body\";s:145:\"Severity is the degree of the problem. This allows differentiation between a critical security flaw versus a slight annoyance with a work-around.\";}i:9;a:3:{s:9:\"keystring\";s:8:\"priority\";s:5:\"title\";s:8:\"Priority\";s:4:\"body\";s:221:\"The priority shows the degree of celerity with which the bug will be fixed. This is different from severity in that, a bug could be a valid issue, but it could be for an old version and thus the priority wouldn\'t be high.\";}i:10;a:3:{s:9:\"keystring\";s:11:\"duplicateof\";s:5:\"title\";s:12:\"Duplicate Of\";s:4:\"body\";s:107:\"If a bug is the same as another one in the bug tracker, you can enter the bug ID of that bug in this field.\";}i:11;a:3:{s:9:\"keystring\";s:10:\"dependency\";s:5:\"title\";s:12:\"Dependencies\";s:4:\"body\";s:177:\"If a bug is affected by another bug, you can enter the ID of the bug that affects this bug here. You can enter multiple values into this field by separating the IDs with spaces.\";}i:12;a:3:{s:9:\"keystring\";s:8:\"newreply\";s:5:\"title\";s:9:\"New Reply\";s:4:\"body\";s:557:\"Here you can specify additional comments. If you do not change any fields, this will merely attach a comment.
+
+The &quot;Automation&quot; drop-down next to this box (which may be hidden) will allow you to perform a common task. These administrator-defined tasks can change any of the bug fields automatically and then add an automatic reply. If you change a field that will be altered by the action, the action\'s change will take precedence. Also, if you enter a comment and the action specifies a comment, the automatic comment will be attached to yours.\";}i:13;a:3:{s:9:\"keystring\";s:11:\"columnorder\";s:5:\"title\";s:22:\"Custom Column Ordering\";s:4:\"body\";s:351:\"You can change the ordering and display of columns on the bug list using these settings. Any column with a position value of &quot;0&quot; will not be displayed in the list. Columns are positioned in the grid with the lowest numbered column starting at the far-left. If columns share a position number, they will be placed in the same column position.\";}}}";
 
 ?>
\ No newline at end of file
index 73cd609e0fd8d095e52cd394e934f0392d91c565..92c1957f2de08d8f455fceb3b0f56f908c574461 100644 (file)
@@ -37,10 +37,10 @@ require_once('./global.php');
        <title>Bugdar: Mail Test</title>
 </head>
 <body>
-       
+
        <h1>Mail Test</h1>
        <p>This tool will run a few email tests to make sure that emailing works. Follow the instructions below.</p>
-       
+
        <hr />
 
 <?php
@@ -51,7 +51,7 @@ if (empty($bugsys->in['__submit__']))
 
        <h2>Email Addresses</h2>
        <p><strong>Enter in the following email addresses for sending and receiving.</strong></p>
-       
+
        <form action="mailtest.php" method="get" accept-charset="utf-8">
                <p>Email address to <em>receieve</em> all tests: <input type="text" name="receive" value="" size="25" /></p>
                <p>An email address that exists on the mail server that is <em>not</em> the one receiving the tests: <input type="text" name="sender" value="" size="25 /"></p>
@@ -68,11 +68,11 @@ else
 PHP: " . phpversion() . "
 Mail Test: " . '$Revision$' . "
 Sendmail (From): \"" . ini_get('sendmail_from') . "\"
-Sendmail (Path): \"" . ini_get('sendmail_path') . "\""; 
-       
+Sendmail (Path): \"" . ini_get('sendmail_path') . "\"";
+
        $mail->setFromName('Bugdar Mailing Test');
        $mail->setSubject('Email Tests');
-       
+
        if (empty($bugsys->in['receive']) OR empty($bugsys->in['sender']) OR !$funct->is_valid_email($bugsys->in['receive']) OR !$funct->is_valid_email($bugsys->in['sender']))
        {
                echo '<p style="color: red">You did not fill in all the fields or the email addresses are not valid. Please <a href="mailtest.php">go back</a>.</p>';
@@ -82,27 +82,27 @@ Sendmail (Path): \"" . ini_get('sendmail_path') . "\"";
                // normal Bugdar mailing
                $mail->setBodyText(sprintf($text, 1, 'sending with the Bugdar-configured address'));
                $mail->send($bugsys->in['receive']);
-       
+
                // mail from the alternate address
                $mail->setBodyText(sprintf($text, 2, 'sending from the address you specified that exists on the mail server'));
                $mail->setFromAddress($bugsys->in['sender']);
                $mail->send($bugsys->in['receive']);
-       
+
                // mail from self
                $mail->setBodyText(sprintf($text, 3, 'sending from the receiving address'));
                $mail->setFromAddress($bugsys->in['receive']);
                $mail->send($bugsys->in['receive']);
-       
+
                // mail from non-existent
                $mail->setBodyText(sprintf($text, 4, 'sending from a non-existent address'));
                $mail->setFromAddress(preg_replace('#(.*)@(.*)#', 'bugdar-mail-test@\2', $bugsys->in['receive']));
                $mail->send($bugsys->in['receive']);
-       
+
 ?>
 
        <h2>Complete</h2>
        <p>All the test emails were sent to <em><?= $bugsys->in['receive'] ?></em>. Please check that you received all 4 tests.</p>
-       
+
 <?php
        }
 }
index 338544121d60770fe19362488471c95030b937a7..1455b12144be2a27358c1dec507ce143507b1eca 100644 (file)
@@ -12,7 +12,7 @@ while ($field = $db->fetch_array($fields))
 {
        // create the database field
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD custom$field[fieldid] MEDIUMTEXT NULL");
-       
+
        // update all the data
        $data = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill");
        while ($custom = $db->fetch_array($data))
index 0582c1ebbc6b983d0bef7ed6c4389c6d40c00cfd..7d3f48297d247c6f733ec72dba642d7839f7ac21 100644 (file)
@@ -6,14 +6,14 @@ if (empty($_REQUEST['do']))
        echo "<input type=\"hidden\" name=\"do\" value=\"go\" />\r";
        echo '<table border="1" cellspacing="2" cellpadding="3">';
        echo "\r<tr><td><strong>Name</strong></td><td><strong>Value</strong></td><td><strong>Del</strong></td></tr>";
-       
+
        foreach ($_COOKIE AS $varname => $value)
        {
                echo "\r<tr><td>" . $varname . '</td><td>' . $value . '</td><td><input type="checkbox" name="del[' . $varname . ']" value="' . $varname . '" /></tr>';
        }
-       
-       echo '</table>'; 
-       
+
+       echo '</table>';
+
        echo "\r<br />\r<input type=\"submit\" name=\"submit\" value=\"Delete Cookies\" /></form>";
 }
 else
@@ -22,7 +22,7 @@ else
        {
                setcookie($remove, '', time() - (2 * 900), '/');
        }
-       
+
        header("Location: mycookies.php");
 }
 
index df0c02bb2f8941638930a42a307fce402e9d8643..b1b4c57b34870632e628485035705d711afded5b 100644 (file)
@@ -5,32 +5,32 @@ include 'includes/api_bug.php';
 include 'includes/api_comment.php';
 
 for ($i = 11; $i < 111; $i++)
-{      
+{
        $bug = new BugAPI($bugsys);
        $comment = new CommentAPI($bugsys);
-       
+
        $bug->set('userid',                     $bugsys->userinfo['userid']);
        $bug->set('username',           $bugsys->userinfo['displayname']);
        $bug->set('summary',            'AUTO POPULATE: ' . $i);
        $bug->set('severity',           1);
-       
+
        $comment->set('userid',         $bugsys->userinfo['userid']);
        $comment->set('comment',        $funct->rand(100));
-       
+
        $bug->set('priority',           $bugsys->options['defaultpriority']);
        $bug->set('status',                     $bugsys->options['defaultstatus']);
        $bug->set('resolution',         $bugsys->options['defaultresolve']);
        $bug->set('assignedto',         $bugsys->options['defaultassign']);
-       
+
        $bug->set('product',            6);
        $bug->set('component',          0);
        $bug->set('version',            14);
-       
+
        $bug->insert();
-       
+
        $comment->set('bugid',          $bug->insertid);
        $comment->insert();
-       
+
        $bug = new BugAPI($bugsys); // need to destroy because update will think the insert fields need to be changed, too
        $bug->dorelations = array();
        $bug->set('bugid',                                      $comment->values['bugid']);
index 47d515f5b79aa4ca693847bcd89d8024f22dd5ff..cf8bfa63556942e6b31e0103c561af0e4b4be855 100755 (executable)
@@ -50,7 +50,7 @@ if (preg_match_all('#(fixe(s|d)|close(s|d)) bug://(report/)?([0-9]*)#i', $output
        chdir(BUGDAR_BASE);
        include 'includes/init.php';
        include 'includes/api_bug.php';
-       
+
        foreach ($matches[5] AS $id)
        {
                $api = new BugAPI($bugsys);
index 87a59562b29c073b4134357fcdda1ea8da40df16..e50f51419f5aab1a48a433369025fc0ee0d3771b 100644 (file)
@@ -21,7 +21,7 @@ while ($comment = $db->fetch_array($comments))
                $replace["$comment[bugid]"]['hiddenlastposttime'] = $comment['dateline'];
                $replace["$comment[bugid]"]['hiddenlastpostby'] = $comment['userid'];
        }
-       
+
        $replace["$comment[bugid]"]['lastposttime'] = $comment['dateline'];
 }
 
index 2f96280aa4755e1fb00aac36ea4964e154b37f2a..0a4a6aa67c84b42f3c0ceb0f5bb1a89c2194d70c 100644 (file)
@@ -13,7 +13,7 @@ $fields = array(
                3 => 4,
                4 => 5
        ),
-       
+
        'severity' => array(
                6 => 1,
                1 => 2,
index abef5e41a139ebe0b023396243a99094e372ec7e..b3e21f22e7bd522821c8dac81bd4e98bc74fdc7b 100644 (file)
@@ -91,18 +91,18 @@ if ($_POST['do'] == 'kill')
        {
                $message->errorPermission();
        }
-       
+
        // get the last post (as in prior to deletion)
        $lastpost = $db->query_first("SELECT commentid FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] ORDER BY dateline DESC");
-       
+
        $commentapi->delete();
-       
+
        // check to see if we need to rebuild the lastpost information
        if ($lastpost['commentid'] == $comment['commentid'])
        {
                update_lastpost_time($bug);
        }
-       
+
        $message->redirect(T('The comment has been deleted. You will be redirected back to the bug.'), 'showreport.php?bugid=' . $bug['bugid']);
 }
 
@@ -114,12 +114,12 @@ if ($_REQUEST['do'] == 'delete')
        {
                $message->errorPermission();
        }
-       
+
        if ($bug['initialreport'] == $comment['commentid'])
        {
                $message->error(T('You cannot delete this comment because it is attached to the bug as the first comment. You have to delete the entire bug instead (which is not recommended unless it is spam).'));
        }
-       
+
        $message->confirm(T('Are you sure you want to delete this comment? After you do so, the data <strong>will</strong> be lost forever. We recommend only deleting spam comments and nothing else.'), 'editcomment.php', 'kill', T('Delete Comment'), 'showreport.php?bugid=' . $bug['bugid'], array('commentid' => $comment['commentid']));
 }
 
@@ -131,26 +131,26 @@ if ($_POST['do'] == 'update')
        {
                $message->errorPermission();
        }
-       
+
        $commentapi->set('comment',     $bugsys->in['comment']);
        $commentapi->set('parselinks', $bugsys->in['parselinks']);
        $commentapi->set('hidden',      $bugsys->in['hidden']);
-       
+
        if ($bugsys->in['commentid'] == $bug['initialreport'] AND $bugsys->in['hidden'])
        {
                $message->addError(T('You cannot hide the first comment/initial report of a bug. Instead, hide the entire bug.'));
        }
-       
+
        if (!$message->hasErrors())
        {
                $commentapi->update();
-               
+
                // setup logging
                require_once('./includes/class_logging.php');
                $log = new Logging;
                $log->set_bugid($bug['bugid']);
                $log->set_commentid($comment['commentid']);
-               
+
                $log->add_data(true, $commentapi->objdata, array('comment', 'hidden'), false, 'comment');
                $log->add_data(false, $commentapi->values, array('comment', 'hidden'), false, 'comment');
 
@@ -175,7 +175,7 @@ if ($_REQUEST['do'] == 'edit')
        {
                $message->errorPermission();
        }
-       
+
        $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']);
        if ($comment['userid'])
        {
index dd95723309f9a8762cf72a48c690f39cf4971d05..d7a685c6f11914a531fccc47a37f58d86eeda392 100644 (file)
@@ -70,9 +70,9 @@ if ($_POST['do'] == 'kill')
        {
                $message->errorPermission();
        }
-       
+
        $bugapi->delete();
-       
+
        $message->redirect(T('The entire bug has been deleted.'), 'index.php');
 }
 
@@ -84,7 +84,7 @@ if ($_REQUEST['do'] == 'delete')
        {
                $message->errorPermission();
        }
-       
+
        $message->confirm(T('Are you sure you want to delete this bug? Doing so will <strong>destroy</strong> all associated data, including comments, attachments, and votes. We strongly recommend only deleting span records and nothing else as users may wish to go back and look at any bug to check its status.'), 'editreport.php', 'kill', T('Delete Bug Permanently'), 'showreport.php?bugid=' . $bug['bugid'], array('bugid' => $bug['bugid']));
 }
 
@@ -96,9 +96,9 @@ if ($_POST['do'] == 'update')
        {
                $message->errorPermission();
        }
-       
+
        $log->add_data(true, $bugapi->objdata, $log->getCommonFields(), true);
-       
+
        // -------------------------------------------------------------------
        // handle automations
        if ($bugsys->in['automation'])
@@ -142,25 +142,25 @@ if ($_POST['do'] == 'update')
                {
                        $commenttext = $bugsys->in['comment'];
                }
-               
+
                $comment = new CommentAPI($bugsys);
                $comment->set('bugid',          $bugsys->in['bugid']);
                $comment->set('userid',         $bugsys->userinfo['userid']);
                $comment->set('comment',        $commenttext);
                $comment->set('parselinks',     $bugsys->in['parselinks']);
                $comment->insert();
-               
+
                // we redefine the bug data later, but it needs to be here in order to generate the user list
                $notif->set_bug_data($bugapi->objdata);
                $notif->send_new_comment_notice($comment->values);
-               
+
                $bugapi->set('lastposttime',                    $comment->values['dateline']);
                $bugapi->set('lastpostby',                              $bugsys->userinfo['userid']);
                $bugapi->set('lastpostbyname',                  $bugsys->userinfo['displayname']);
                $bugapi->set('hiddenlastposttime',              $comment->values['dateline']);
                $bugapi->set('hiddenlastpostby',                $bugsys->userinfo['userid']);
                $bugapi->set('hiddenlastpostbyname',    $bugsys->userinfo['displayname']);
-               
+
                if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])))
                {
                        $bugapi->update();
@@ -168,12 +168,12 @@ if ($_POST['do'] == 'update')
                        $message->redirect(T('Your reply has been added to the comment list.'), "showreport.php?bugid=$bug[bugid]");
                }
        }
-       
+
        // -------------------------------------------------------------------
-       // do update stuff      
+       // do update stuff
        $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY);
        $dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies));
-       
+
        if ((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid']))
        {
                $bugapi->set('summary',         $bugsys->in['summary']);
@@ -181,13 +181,13 @@ if ($_POST['do'] == 'update')
                $bugapi->set('duplicateof',     $bugsys->in['duplicateof']);
                $bugapi->set('dependency',      $dependencies);
                $bugapi->set('hidden',          $bugsys->in['hidden']);
-       
+
                $product = explode(',',         $bugsys->in['product']);
                $bugapi->set('product',         $product[0]);
                $bugapi->set('component',       $product[1]);
                $bugapi->set('version',         $product[2]);
        }
-       
+
        if (can_perform('canchangestatus', $bug['product']))
        {
                $bugapi->set('priority',        $bugsys->in['priority']);
@@ -198,15 +198,15 @@ if ($_POST['do'] == 'update')
        {
                $bugapi->set('assignedto',      $bugsys->in['assignedto']);
        }
-       
+
        process_custom_fields($bugapi, $message, false);
-       
+
        // -------------------------------------------------------------------
        // handle logging and perform updates
-       
+
        $notif->set_bug_data($bugapi->objdata, array_merge($bugapi->objdata, $bugapi->values));
        $log->add_data(false, $bugapi->values, $log->getCommonFields(), true);
-       
+
        if (!$message->hasErrors())
        {
                $bugapi->update();
@@ -215,16 +215,16 @@ if ($_POST['do'] == 'update')
        {
                $message->error();
        }
-       
+
        // -------------------------------------------------------------------
        // do diff history
 
        $log->update_history();
-       
+
        $notif->send_bug_changes_notice();
-       
+
        $notif->finalize();
-       
+
        $message->redirect(T('Your changes to the bug have been saved.'), "showreport.php?bugid=$bug[bugid]");
 }
 
index 9e2b20b5ab634c5170473eb9c65035b634aa67d2..9332e4ca6cfc17df896ec461191a85f8190d4578 100644 (file)
@@ -45,7 +45,7 @@ if ($_REQUEST['do'] == 'products')
        {
                $message->error(T('There are no products set up.'));
        }
-       
+
        foreach (bugdar::$datastore['product'] AS $product)
        {
                if ($product['parentid'])
@@ -57,12 +57,12 @@ if ($_REQUEST['do'] == 'products')
                        $products["$product[productid]"] = $product;
                }
        }
-       
+
        foreach (bugdar::$datastore['version'] AS $version)
        {
                $versions["$version[productid]"]["$version[versionid]"] = $version;
        }
-       
+
        // global versions
        if (is_array($versions['0']))
        {
@@ -73,14 +73,14 @@ if ($_REQUEST['do'] == 'products')
                        eval('$globalversions .= "' . $template->fetch('explain_row') . '";');
                }
        }
-       
+
        foreach ($products AS $product)
        {
                $left = $product['title'];
                $right = $product['description'];
                $trextra = ' class="altcolor"';
                eval('$productlist .= "' . $template->fetch('explain_row') . '";');
-               
+
                if (is_array($components["$product[productid]"]))
                {
                        foreach ($components["$product[productid]"] AS $component)
@@ -92,7 +92,7 @@ if ($_REQUEST['do'] == 'products')
                        }
                }
        }
-       
+
        eval('$template->flush("' . $template->fetch('explain_product') . '");');
 }
 
@@ -113,30 +113,30 @@ if ($_REQUEST['do'] == 'automations')
        {
                $fields["$field[fieldid]"] = $field;
        }
-       
+
        if (is_array(bugdar::$datastore['automation']))
        {
                foreach (bugdar::$datastore['automation'] AS $automation)
                {
                        $automation['fieldchanges'] = unserialize($automation['fieldchanges']);
-                       
+
                        $left = $automation['name'];
                        $right = $automation['description'];
                        $trextra = ' class="listinghead"';
-                       
+
                        eval('$automations .= "' . $template->fetch('explain_row') . '";');
-                       
+
                        if ($automation['comment'])
                        {
                                $left = T('Add Comment');
                                $right = $automation['comment'];
                                $trextra = ' class="altcolor"';
-                               
+
                                eval('$automations .= "' . $template->fetch('explain_row') . '";');
                        }
-                       
+
                        $trextra = '';
-                       
+
                        if (is_array($automation['fieldchanges']['builtin']))
                        {
                                foreach ($automation['fieldchanges']['builtin'] AS $name => $value)
@@ -146,7 +146,7 @@ if ($_REQUEST['do'] == 'automations')
                                        eval('$automations .= "' . $template->fetch('explain_row') . '";');
                                }
                        }
-                       
+
                        if (is_array($automation['fieldchanges']['custom']))
                        {
                                foreach ($automation['fieldchanges']['custom'] AS $id => $value)
@@ -155,7 +155,7 @@ if ($_REQUEST['do'] == 'automations')
                                        {
                                                continue;
                                        }
-                                       
+
                                        $left = $fields["$id"]['name'] . ' ' . sprintf(T('(Custom #%1$d, type: %2$s)'), $id, $fields["$id"]['type']);
                                        $right = $value;
                                        eval('$automations .= "' . $template->fetch('explain_row') . '";');
@@ -163,7 +163,7 @@ if ($_REQUEST['do'] == 'automations')
                        }
                }
        }
-       
+
        eval('$template->flush("' . $template->fetch('explain_automation') . '");');
 }
 
index 2497297d3789e2063bec00601c7378c376f7f3de..8b043c9cc8830f87764fa6a2f57066ad9d6fd3fc 100644 (file)
@@ -46,12 +46,12 @@ if ($_REQUEST['do'] == 'handle')
        {
                $message->errorPermission();
        }
-       
+
        if (!can_perform('cansubscribe', $bug['product']))
        {
                $message->errorPermission();
        }
-       
+
        if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']))
        {
                $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']);
@@ -72,7 +72,7 @@ if ($_REQUEST['do'] == 'manage')
        {
                $message->errorPermission();
        }
-       
+
        $favorites = $db->query("
                SELECT favorite.bugid, bug.* FROM " . TABLE_PREFIX . "favorite AS favorite
                RIGHT JOIN " . TABLE_PREFIX . "bug AS bug
@@ -80,23 +80,23 @@ if ($_REQUEST['do'] == 'manage')
                WHERE favorite.userid = " . $bugsys->userinfo['userid'] . "
                AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $bugsys->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")
        ");
-       
+
        if ($db->num_rows($favorites) < 1)
        {
                $message->error(T('You do not have any favorites in your list. To add a bug to your list, while viewing the report, click the [Add to Favorites] link next to the bug\'s ID.'));
        }
-       
+
        $sort = new ListSorter('favorite');
-       
+
        $headers = $sort->constructColumnHeaders(false);
-       
+
        while ($bug = $db->fetch_array($favorites))
        {
                $funct->exec_swap_bg('altcolor', '');
                $bug = ProcessBugDataForDisplay($bug, $funct->bgcolour);
                $bugs .= $sort->constructRow($bug);
        }
-       
+
        eval('$template->flush("' . $template->fetch('favorites') . '");');
 }
 
index 26f24ac5206383e8152edeb3bf0ee09b9ef2dd4c..8ae9872fd9431dc024079f9ab876a92cf7f468d8 100644 (file)
 */
 
 if (!defined('REQ_AUTO'))
-{      
+{
        /**
        * Auto-increasing value
        */
        define('REQ_AUTO', -1);
-       
+
        /**
        * Set by a cusotm set_*() function
        */
        define('REQ_SET', 2);
-       
+
        /**
        * Index for cleaning type
        */
        define('F_TYPE', 0);
-       
+
        /**
        * Index for requirement type
        */
        define('F_REQ', 1);
-       
+
        /**
        * Index for verification type
        */
        define('F_VERIFY', 2);
-       
+
        /**
        * Index for relation
        */
        define('F_RELATION', 3);
-       
+
        /**
        * Relation index for file name, relative to ISSO->apppath
        */
        define('F_RELATION_FILE', 0);
-       
+
        /**
        * Relation index for class name
        */
        define('F_RELATION_CLASS', 1);
-       
+
        /**
        * Relation index for field-link alternate name
        */
@@ -85,7 +85,7 @@ if (!defined('REQ_AUTO'))
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class API
 {
@@ -95,7 +95,7 @@ class API
        * @access       protected
        */
        var $registry = null;
-       
+
        /**
        * Fields: used for verification and sanitization
        * NAME => array(TYPE, REQUIRED, VERIFY METHOD (:self for self-named method), RELATION => array(FILE, CLASS IN FILE, ALTERNATE FIELD NAME))
@@ -103,70 +103,70 @@ class API
        * @access       protected
        */
        var $fields = array();
-       
+
        /**
        * Values array: sanitized and verified field values
        * @var  array
        * @access       public
        */
        var $values = array();
-       
+
        /**
        * Fields that were manually set with set(), not by using set_existing()
        * @var  array
        * @access       private
        */
        var $setfields = array();
-       
+
        /**
        * An array of all of the processed relations on an object
        * @var  array
        * @access       public
        */
        var $relations = array();
-       
+
        /**
        * WHERE condition
        * @var  string
        * @access       private
        */
        var $condition = '';
-       
+
        /**
        * The object table row; a fetched row that represents this instance
        * @var  array
        * @access       public
        */
        var $objdata = array();
-       
+
        /**
        * Insert ID from the insert() command
        * @var  integer
        * @access       public
        */
        var $insertid = 0;
-       
+
        /**
        * Pre- and post-action method stoppers
        * @var  array
        * @access       public
        */
        var $norunners = array();
-       
+
        /**
        * The relations to execute on
        * @var  array
        * @access       public
        */
        var $dorelations = array('fetch');
-       
+
        /**
        * Error list that has been generated
        * @var  array
        * @access       private
        */
        var $errors = array();
-       
+
        // ###################################################################
        /**
        * Constructor: cannot instantiate class directly
@@ -177,15 +177,15 @@ class API
                {
                        trigger_error('Cannot instantiate the API module directly', E_USER_ERROR);
                }
-               
+
                if (!is_object($registry))
                {
                        trigger_error('The passed registry is not an object', E_USER_ERROR);
                }
-               
+
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -194,7 +194,7 @@ class API
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Constructs an error for the error handler to receive
@@ -206,21 +206,21 @@ class API
        function error($message)
        {
                $this->errors[] = $message;
-               
+
                // we want to explicitly specify silence
                if (APIError() == 'silent')
                {
                        return;
                }
-               
+
                if (!is_callable(APIError()))
                {
                        trigger_error('No APIError() handler has been set', E_USER_WARNING);
                }
-               
+
                call_user_func(APIError(), $message);
        }
-       
+
        // ###################################################################
        /**
        * Returns the error list. This is because we don't want people mucking
@@ -237,10 +237,10 @@ class API
                {
                        return array();
                }
-               
+
                return $this->errors;
        }
-       
+
        // ###################################################################
        /**
        * Sets a value, sanitizes it, and verifies it
@@ -259,11 +259,11 @@ class API
                        trigger_error('Field `' . $field . '` is not valid', E_USER_WARNING);
                        return;
                }
-               
+
                $this->values["$field"] = ($doclean ? $this->registry->clean($value, $this->fields["$field"][F_TYPE]) : $value);
-               
+
                $this->setfields["$field"] = $field;
-               
+
                if (isset($this->fields["$field"][F_VERIFY]) AND $doverify)
                {
                        if ($this->fields["$field"][F_VERIFY] == ':self')
@@ -274,7 +274,7 @@ class API
                        {
                                $verify = $this->{$this->fields["$field"][F_VERIFY]}($field);
                        }
-                       
+
                        if ($verify !== true)
                        {
                                if ($verify === false)
@@ -288,7 +288,7 @@ class API
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Sets the condition to use in the WHERE clause; if not passed, then
@@ -303,7 +303,7 @@ class API
                if (is_array($condition) AND sizeof($condition) > 0)
                {
                        $this->condition = '';
-                       
+
                        foreach ($condition AS $field)
                        {
                                if (!$this->values["$field"])
@@ -311,7 +311,7 @@ class API
                                        trigger_error('The specified field `' . $field . '` for the condition could not be found as it is not set', E_USER_WARNING);
                                        continue;
                                }
-                               
+
                                $condbits[] = "$field = " . $this->prepare_field_for_sql($field);
                        }
                        $this->condition = implode(' AND ', $condbits);
@@ -320,7 +320,7 @@ class API
                {
                        $this->condition = $condition;
                }
-               else 
+               else
                {
                        foreach ($this->fields AS $name => $options)
                        {
@@ -331,18 +331,18 @@ class API
                                                trigger_error('Cannot determine condition from the REQ_AUTO field because it is not set', E_USER_WARNING);
                                                continue;
                                        }
-                                       
+
                                        $this->condition = "$name = " . $this->prepare_field_for_sql($name);
                                }
                        }
-                       
+
                        if ($this->condition == '')
                        {
                                trigger_error('No REQ_AUTO fields are present and therefore the condition cannot be created', E_USER_WARNING);
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Sets existing data into $values where it's not already present
@@ -356,9 +356,9 @@ class API
                {
                        return;
                }
-               
+
                $this->fetch();
-               
+
                foreach ($this->objdata AS $field => $value)
                {
                        if (!isset($this->values["$field"]))
@@ -366,10 +366,10 @@ class API
                                $this->values["$field"] = $value;
                        }
                }
-               
+
                $run = true;
        }
-       
+
        // ###################################################################
        /**
        * Fetches a record based on the condition
@@ -384,20 +384,20 @@ class API
                {
                        trigger_error('Condition is empty: cannot fetch', E_USER_ERROR);
                }
-               
+
                $this->run_action_method('pre_fetch');
-               
+
                $result = $this->registry->modules[ISSO_DB_LAYER]->query_first("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}");
                if (!$result)
                {
                        $this->error(T('No records were returned'));
                        return;
                }
-               
+
                $this->run_action_method('post_fetch');
-               
+
                $this->objdata = $result;
-               
+
                if ($populate)
                {
                        foreach ($this->objdata AS $key => $value)
@@ -408,10 +408,10 @@ class API
                                }
                        }
                }
-               
-               $this->call_relations('fetch');         
+
+               $this->call_relations('fetch');
        }
-       
+
        // ###################################################################
        /**
        * Inserts a record in the database
@@ -421,17 +421,17 @@ class API
        function insert()
        {
                $this->verify();
-               
+
                $this->run_action_method('pre_insert');
-               
+
                foreach ($this->setfields AS $field)
                {
                        $fields[] = $field;
                        $values[] = $this->prepare_field_for_sql($field);
                }
-               
+
                $this->registry->modules[ISSO_DB_LAYER]->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")");
-               
+
                if (strcasecmp(ISSO_DB_LAYER, 'DB_PostgreSQL') == 0)
                {
                        foreach ($this->fields AS $field => $info)
@@ -442,17 +442,17 @@ class API
                                        break;
                                }
                        }
-                       
+
                        $this->insertid = $this->registry->modules[ISSO_DB_LAYER]->insert_id($this->prefix . $this->table, $autofield);
                }
                else
                {
                        $this->insertid = $this->registry->modules[ISSO_DB_LAYER]->insert_id();
                }
-               
+
                $this->run_action_method('post_insert');
        }
-       
+
        // ###################################################################
        /**
        * Updates a record in the database using the data in $vaues
@@ -467,18 +467,18 @@ class API
                }
 
                $this->run_action_method('pre_update');
-               
+
                foreach ($this->setfields AS $field)
                {
                        $updates[] = "$field = " . $this->prepare_field_for_sql($field);
                }
                $updates = implode(', ', $updates);
-               
+
                $this->registry->modules[ISSO_DB_LAYER]->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}");
-               
+
                $this->run_action_method('post_update');
        }
-       
+
        // ###################################################################
        /**
        * Deletes a record
@@ -493,19 +493,19 @@ class API
                {
                        trigger_error('Condition is empty: cannot delete', E_USER_ERROR);
                }
-               
+
                if ($runset)
                {
                        $this->set_existing();
                }
-               
+
                $this->run_action_method('pre_delete');
-               
+
                $this->registry->modules[ISSO_DB_LAYER]->query("DELETE FROM {$this->prefix}{$this->table} WHERE {$this->condition}");
-               
+
                $this->run_action_method('post_delete');
        }
-       
+
        // ###################################################################
        /**
        * Verifies that all required fields are set
@@ -529,7 +529,7 @@ class API
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Runs a pre- or post-action method for database commands
@@ -544,10 +544,10 @@ class API
                {
                        return;
                }
-               
+
                $actmethod = (method_exists($this, $method) ? $this->$method() : '');
        }
-       
+
        // ###################################################################
        /**
        * Determines if it's safe to run a relation; if so, it will return
@@ -563,7 +563,7 @@ class API
                {
                        return;
                }
-               
+
                foreach ($this->fields AS $field => $info)
                {
                        $value = (isset($this->values["$field"]) ? $this->values["$field"] : $this->objdata["$field"]);
@@ -571,21 +571,21 @@ class API
                        {
                                continue;
                        }
-                       
+
                        if (!file_exists($this->registry->getAppPath() . $info[F_RELATION][F_RELATION_FILE]))
                        {
                                trigger_error("Could not load the relation file for field '$field'");
                        }
-                       
+
                        require_once($this->registry->getAppPath() . $info[F_RELATION][F_RELATION_FILE]);
-                       
+
                        $this->relations["$field"] = new $info[F_RELATION][F_RELATION_CLASS]($this->registry);
                        $this->relations["$field"]->set(($info[F_RELATION][F_RELATION_ALTFIELD] ? $info[F_RELATION][F_RELATION_ALTFIELD] : $field), $value);
                        $this->relations["$field"]->set_condition();
                        $this->relations["$field"]->$method();
                }
        }
-       
+
        // ###################################################################
        /**
        * Prepares a value for use in a SQL query; it encases and escapes
@@ -600,7 +600,7 @@ class API
        function prepare_field_for_sql($name)
        {
                $type = $this->fields["$name"][F_TYPE];
-               
+
                if ($type == TYPE_NOCLEAN OR $type == TYPE_STR OR $type == TYPE_STRUN)
                {
                        return "'" . $this->registry->db->escape_string($this->values["$name"]) . "'";
@@ -618,7 +618,7 @@ class API
                        return $this->values["$name"];
                }
        }
-       
+
        // ###################################################################
        /**
        * Verify field: not a zero value
@@ -631,10 +631,10 @@ class API
                {
                        return sprintf(T('The field "%1$s" cannot be zero'), $field);
                }
-               
+
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify field: not empty
@@ -647,7 +647,7 @@ class API
                {
                        return sprintf(T('The field "%1$s" cannot be empty'), $field);
                }
-               
+
                return true;
        }
 }
@@ -666,7 +666,7 @@ class API
 function APIError($new = null)
 {
        static $caller, $prev;
-       
+
        if ($new === -1)
        {
                $caller = $prev;
@@ -676,7 +676,7 @@ function APIError($new = null)
                $prev = $caller;
                $caller = $new;
        }
-       
+
        return $caller;
 }
 
index 3e67537695dcd0f705b1875e591a4844eef35682..f6cdce8a23644852241b075a5af2db3f99409882 100644 (file)
@@ -42,7 +42,7 @@ define('TIMENOW', time());
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Date
 {
@@ -52,35 +52,35 @@ class Date
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * User timezone offset
        * @var  integer
        * @access       public
        */
        var $usertz = 0;
-       
+
        /**
        * Server's timezone offset; this is set using fetch_offset()
        * @var  integer
        * @access       private
        */
        var $servertz = 0;
-       
+
        /**
        * Total offset timezone; this is set using fetch_offset()
        * @var  integer
        * @access       private
        */
        var $offsettz = 0;
-       
+
        /**
        * Offset in seconds; this is set using fetch_offset()
        * @var  integer
        * @access       private
        */
        var $offset = 0;
-       
+
        // ###################################################################
        /**
        * Constructor: sets the server's timezone
@@ -88,10 +88,10 @@ class Date
        function __construct(&$registry)
        {
                $this->registry =& $registry;
-               
+
                $this->servertz = date('Z', TIMENOW) / 3600;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -100,7 +100,7 @@ class Date
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Sets the user timezone variable
@@ -113,7 +113,7 @@ class Date
        {
                $this->usertz = $tz;
        }
-       
+
        // ###################################################################
        /**
        * Gets the user timezone variable
@@ -126,7 +126,7 @@ class Date
        {
                return $this->usertz;
        }
-               
+
        // ###################################################################
        /**
        * Computes the total offset, taking into account all the various
@@ -139,7 +139,7 @@ class Date
                $this->offsettz = $this->servertz - $this->usertz;
                $this->offset = $this->offsettz * 3600;
        }
-       
+
        // ###################################################################
        /**
        * Formats a UNIX timestamp to a certain date format in the proper time
@@ -159,10 +159,10 @@ class Date
                {
                        $timestamp -= $this->offset;
                }
-               
+
                return date($format, $timestamp);
        }
-       
+
        // ###################################################################
        /**
        * Fetches an array of timezones for a <select> list
@@ -174,7 +174,7 @@ class Date
        function fetch_timezone_list()
        {
                $opt = array();
-               
+
                $opt['-12']             = T('(GMT - 12:00) Enitwetok, Kwajalien');
                $opt['-11']             = T('(GMT - 11:00) Midway Island, Samoa');
                $opt['-10']             = T('(GMT - 10:00) Hawaii');
@@ -205,7 +205,7 @@ class Date
                $opt['10']              = T('(GMT + 10:00) Guam, Papua New Guinea, Sydney');
                $opt['11']              = T('(GMT + 11:00) Magadan, New Caledonia, Solomon Islands');
                $opt['12']              = T('(GMT + 12:00) Auckland, Wellington, Fiji');
-               
+
                return $opt;
        }
 }
index bd57eb32edb645ef8d8e517064c2becb8ff862d1..5e4e760e20d46d12447ec74823bb92a7e86a2134 100644 (file)
@@ -19,7 +19,7 @@ $isso->load('template', 'template', true);
 // ###################################################################
 
 $data = '<tr valign="middle">
-       <td class="alt1">               
+       <td class="alt1">
                <span style="float: right; display: inline" class="smallfont">
                1 <if condition="$show[\'edit\']">
                        2 <if condition="$show[\'receive\']">
@@ -41,7 +41,7 @@ $data = '<tr valign="middle">
                        /3 </if>
                /1 </if>
                </span>
-               
+
                <if condition="$iteminfo[\'url\']"><a href="$iteminfo[url]" target="_blank">$iteminfo[name]</a><else />$iteminfo[name]</if>
        </td>
        <td class="alt2">$iteminfo[price]</td>
index 3b465c0c79b34aaecb46e2f0160362591611a266..4ff29392f1a831f0b5a58fa9d47da3e5c2891431 100644 (file)
@@ -46,35 +46,35 @@ class Functions
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * The path that is used to set cookies
        * @var  string
        * @access       private
        */
        var $cookiepath = '/';
-       
+
        /**
        * The domain used for cookie setting
        * @var  string
        * @access       private
        */
        var $cookiedom = '';
-       
+
        /**
        * The time it takes for a cookie to expire
        * @var  integer
        * @access       private
        */
        var $cookieexp = 900;
-       
+
        /**
        * State of the current background colour during alternation
        * @var  string
        * @access       public
        */
        var $bgcolour = '';
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -83,7 +83,7 @@ class Functions
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -92,7 +92,7 @@ class Functions
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Sets the cookie path
@@ -105,7 +105,7 @@ class Functions
        {
                $this->cookiepath = $path;
        }
-       
+
        // ###################################################################
        /**
        * Gets the cookie path
@@ -118,7 +118,7 @@ class Functions
        {
                return $this->cookiepath;
        }
-       
+
        // ###################################################################
        /**
        * Sets the cookie domain
@@ -131,7 +131,7 @@ class Functions
        {
                $this->cookiedom = $domain;
        }
-       
+
        // ###################################################################
        /**
        * Gets the cookie domain
@@ -144,7 +144,7 @@ class Functions
        {
                return $this->cookiedom;
        }
-       
+
        // ###################################################################
        /**
        * Sets the cookie expiration time
@@ -157,7 +157,7 @@ class Functions
        {
                $this->cookieexp = $exp;
        }
-       
+
        // ###################################################################
        /**
        * Gets the cookie expiration time
@@ -170,7 +170,7 @@ class Functions
        {
                return $this->cookieexp;
        }
-       
+
        // ###################################################################
        /**
        * Sets a cookie with a friendly interface
@@ -199,11 +199,11 @@ class Functions
                        {
                                $expire = time() + $this->cookieexp;
                        }
-                       
+
                        setcookie($name, $value, $expire, $this->cookiepath, $this->cookiedom);
                }
        }
-       
+
        // ###################################################################
        /**
        * Alternate between two background colours
@@ -216,11 +216,11 @@ class Functions
        function exec_swap_bg($class1 = 'alt1', $class2 = 'alt2')
        {
                static $count;
-               
+
                $this->bgcolour = ($count % 2) ? $class1 : $class2;
                $count++;
        }
-       
+
        // ###################################################################
        /**
        * Force-download a file by sending application/octetstream
@@ -241,22 +241,22 @@ class Functions
                {
                        $mime = 'application/octet-stream';
                }
-               
+
                header("Content-Type: $mime");
                header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
                header('Content-Disposition: attachment; filename="' . $name . '"');
                header('Content-length: ' . strlen($file));
                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                header('Pragma: public');
-               
+
                print($file);
-               
+
                if ($exit)
                {
                        exit;
                }
        }
-       
+
        // ###################################################################
        /**
        * Verify that an email address is valid via regex
@@ -278,7 +278,7 @@ class Functions
                        return false;
                }
        }
-       
+
        // ###################################################################
        /**
        * Check a browser's user agent against a pre-determined list
@@ -295,7 +295,7 @@ class Functions
                $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
                $browser = array();
                $matches = array();
-               
+
                // -------------------------------------------------------------------
                // -- Opera
                // -------------------------------------------------------------------
@@ -310,7 +310,7 @@ class Functions
                                $browser['opera'] = $matches[1];
                        }
                }
-               
+
                // -------------------------------------------------------------------
                // -- Mac browser
                // -------------------------------------------------------------------
@@ -318,7 +318,7 @@ class Functions
                {
                        $browser['mac'] = true;
                }
-               
+
                // -------------------------------------------------------------------
                // -- Internet explorer
                // -------------------------------------------------------------------
@@ -331,7 +331,7 @@ class Functions
                                $browser['ie'] = $matches[1];
                        }
                }
-               
+
                // -------------------------------------------------------------------
                // -- Safari
                // -------------------------------------------------------------------
@@ -343,7 +343,7 @@ class Functions
                                $browser['safari'] = $matches[1];
                        }
                }
-               
+
                // -------------------------------------------------------------------
                // -- Konqueror
                // -------------------------------------------------------------------
@@ -356,7 +356,7 @@ class Functions
                                $browser['konqueror'] = $matches[1];
                        }
                }
-               
+
                // -------------------------------------------------------------------
                // -- Mozilla
                // -------------------------------------------------------------------
@@ -368,7 +368,7 @@ class Functions
                        {
                                $browser['mozilla'] = $matches[1];
                        }
-                       
+
                        // -------------------------------------------------------------------
                        // -- Firefox
                        // -------------------------------------------------------------------
@@ -381,7 +381,7 @@ class Functions
                                        $browser['firefox'] = $matches[3];
                                }
                        }
-                       
+
                        // -------------------------------------------------------------------
                        // -- Netscape
                        // -------------------------------------------------------------------
@@ -393,7 +393,7 @@ class Functions
                                        $browser['netscape'] = $matches[2];
                                }
                        }
-                       
+
                        // -------------------------------------------------------------------
                        // -- Camino
                        // -------------------------------------------------------------------
@@ -406,7 +406,7 @@ class Functions
                                }
                        }
                }
-               
+
                if (isset($browser["$check"]))
                {
                        if ($version)
@@ -430,7 +430,7 @@ class Functions
                        return false;
                }
        }
-       
+
        // ###################################################################
        /**
        * Generates a random string of random length (unless otherwise
@@ -454,50 +454,50 @@ class Functions
                        // Gimme a length!
                        $length = rand(20, 65);
                }
-               
+
                // Number of ints in our salt
                $intcount = rand(1, intval($length / 2));
-               
+
                // Number of chars
                $charcount = $length - $intcount;
-               
+
                // Upper-case chars
                $upperchars = rand(1, intval($charcount / 2));
-               
+
                // Lower-case chars
                $lowerchars = $charcount - $upperchars;
-               
+
                // Generate ints
                for ($i = 0; $i < $intcount; $i++)
                {
                        $string[ mt_rand() ] = rand(0, 9);
                }
-               
+
                // Generate upper chars
                for ($i = 0; $i < $upperchars; $i++)
                {
                        $string[ mt_rand() ] = chr(rand(65, 90));
                }
-               
+
                // Generate lower chars
                for ($i = 0; $i < $lowerchars; $i++)
                {
                        $string[ mt_rand() ] = chr(rand(97, 122));
                }
-               
+
                // Sort the chars by thier random assignment
                ksort($string);
-               
+
                // Flatten the array
                $return = '';
                foreach ($string AS $char)
                {
                        $return .= $char;
                }
-               
+
                return $return;
        }
-       
+
        // ###################################################################
        /**
        * Sets the current array position to be the specified key. This
@@ -523,7 +523,7 @@ class Functions
                }
                return current($array);
        }
-       
+
        // ###################################################################
        /**
        * Calculates the microtime difference by taking a given microtime and
@@ -542,7 +542,7 @@ class Functions
                list ($endtime['micro'], $endtime['sec']) = explode(' ', $mtend);
                return ($endtime['micro'] + $endtime['sec']) - ($starttime['micro'] + $starttime['sec']);
        }
-       
+
        // ###################################################################
        /**
        * Fetches the extension of a file by extracting everything after the
@@ -558,7 +558,7 @@ class Functions
        {
                return strval(end(explode('.', $filename)));
        }
-       
+
        // ###################################################################
        /**
        * Gets the maximum file size for attachment uploading, as specified by
@@ -587,7 +587,7 @@ class Functions
                        return 10 * 1048576;
                }
        }
-       
+
        // ###################################################################
        /**
        * Scans a specified directory path and returns an array of all the
@@ -605,17 +605,17 @@ class Functions
        function scandir($path, $recurse = true, $ignoredot = true, $ignorecvs = true, $basepath = '', $unset = 1)
        {
                static $filelist;
-               
+
                if ($unset)
                {
                        $filelist = array();
                }
-               
+
                if (substr($path, (strlen($path) - 1), 1) != '/')
                {
                        $path .= '/';
                }
-               
+
                if ($handle = opendir($path))
                {
                        while (($file = readdir($handle)) !== false)
@@ -644,7 +644,7 @@ class Functions
                }
                return $filelist;
        }
-       
+
        // ###################################################################
        /**
        * Changes line breaks into one format
@@ -663,7 +663,7 @@ class Functions
                $text = str_replace("\n", $convert_to, $text);
                return $text;
        }
-       
+
        // ###################################################################
        /**
        * Removes all empty() [by PHP's standards] elements in an array. This
index e001a1032dd884647e22407602a1cddf405bf061..2b7a5187f1d9e5478b9d73c8642d8cb4483986b4 100644 (file)
@@ -36,7 +36,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Graph_Pie
 {
@@ -46,7 +46,7 @@ class Graph_Pie
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * Graphing data set; 2D array of
        * array(NAME, PERCENT, COLOR)
@@ -54,35 +54,35 @@ class Graph_Pie
        * @access       private
        */
        var $dataset = array();
-       
+
        /**
        * Image resource
        * @var  resource
        * @access       private
        */
        var $image = null;
-       
+
        /**
        * The dimensions of the image
        * @var  array
        * @access       private
        */
        var $dimensions = array('width' => 550, 'height' => 350);
-       
+
        /**
        * Add a legend to the graph
        * @var  bool
        * @access       private
        */
        var $legend = true;
-       
+
        /**
        * Title of the graph
        * @var  string
        * @access       private
        */
        var $title = 'ISSO Pie Chart';
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -90,10 +90,10 @@ class Graph_Pie
        function __construct(&$registry)
        {
                $this->registry =& $registry;
-               
+
                $this->set_scale(0);
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -102,7 +102,7 @@ class Graph_Pie
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Graphs the actual graph and returns a byte stream
@@ -116,33 +116,33 @@ class Graph_Pie
                $colours['black'] = imagecolorallocate($this->image, 0, 0, 0);
                $colours['white'] = imagecolorallocate($this->image, 255, 255, 255);
                $colours['grey'] = imagecolorallocate($this->image, 121, 121, 123);
-               
+
                $graphpadding = 10;
                $graphspacing = 4;
                $diameter = $this->dimensions['height'] - (5 * $graphpadding);
                $radius = $diameter / 2;
                $graphstart = $graphpadding + imagefontheight(5) + $graphpadding;
                $legendbox = 10;
-               
+
                // fill background
                imagefill($this->image, 0, 0, $colours['white']);
-               
+
                // title the chart
                imagestring($this->image, 5, ($this->dimensions['width'] - (imagefontwidth(5) * strlen($this->title))) / 2, $graphpadding, $this->title, $colours['black']);
-               
+
                $center = array(
                        'x' => ($this->legend ? ($radius + $graphpadding) : ($this->dimensions['width'] / 2)),
                        'y' => ($this->dimensions['height'] / 2) + $graphpadding
                );
-               
+
                // draw a border
                imageline($this->image, 0, 0, 0, $this->dimensions['height'], $colours['black']); // left
                imageline($this->image, 0, $this->dimensions['height'] - 1, $this->dimensions['width'], $this->dimensions['height'] - 1, $colours['black']); // bottom
                imageline($this->image, $this->dimensions['width'] - 1, 0, $this->dimensions['width'] - 1, $this->dimensions['height'], $colours['black']); // right
                imageline($this->image, 0, 0, $this->dimensions['width'], 0, $colours['black']); // top
-               
+
                $legx = (2 * $graphpadding) + $diameter;
-               
+
                $lastdeg = 0;
                $boxoffset = 0;
                foreach ($this->dataset AS $plot)
@@ -151,7 +151,7 @@ class Graph_Pie
                        imagefilledarc($this->image, $center['x'], $center['y'], $diameter, $diameter, $lastdeg, $deg + $lastdeg, $plot[2], IMG_ARC_PIE);
                        imagefilledarc($this->image, $center['x'], $center['y'], $diameter, $diameter, $lastdeg, $deg + $lastdeg, $colours['grey'], IMG_ARC_EDGED | IMG_ARC_NOFILL);
                        $lastdeg += $deg;
-                       
+
                        if ($this->legend)
                        {
                                $box = array(
@@ -161,16 +161,16 @@ class Graph_Pie
                                        $legx + 1 + $graphspacing + $legendbox, $graphstart + 1 + $graphspacing + $boxoffset // top right
                                );
                                imagefilledpolygon($this->image, $box, 4, $plot[2]);
-                               
+
                                imagestring($this->image, 2, ($legx + 1 + $graphspacing + $legendbox + $graphspacing), ($graphstart + $graphspacing + $boxoffset), $plot[0] . " ($plot[1]%)", $colours['black']);
-                               
+
                                $boxoffset += $graphspacing + $legendbox;
                        }
                }
-               
+
                // draw the ellipse (do here so it cleans up the arc edges)
                imageellipse($this->image, $center['x'], $center['y'], $diameter, $diameter, $colours['grey']);
-               
+
                // do the legend
                if ($this->legend)
                {
@@ -179,7 +179,7 @@ class Graph_Pie
                        imageline($this->image, $legx, $legy, $this->dimensions['width'] - $graphpadding, $legy, $colours['black']); // bottom
                        imageline($this->image, $this->dimensions['width'] - $graphpadding, $graphstart, $this->dimensions['width'] - $graphpadding, $legy, $colours['black']); // right
                }
-               
+
                ob_start();
                imagepng($this->image);
                $data = ob_get_contents();
@@ -189,10 +189,10 @@ class Graph_Pie
                }
                ob_clean();
                ob_end_clean();
-               
+
                return $data;
        }
-       
+
        // ###################################################################
        /**
        * Sets the width and height by using scale factors of 550x350; you
@@ -207,7 +207,7 @@ class Graph_Pie
        {
                $this->dimensions['width'] = 550;
                $this->dimensions['height'] = 350;
-               
+
                if ($scale > 0)
                {
                        $this->dimensions['width'] *= $scale;
@@ -219,15 +219,15 @@ class Graph_Pie
                        $this->dimensions['width'] /= $scale;
                        $this->dimensions['height'] /= $scale;
                }
-               
+
                if (!is_null($this->image))
                {
                        imagedestroy($this->image);
                }
-               
+
                $this->image = imagecreate($this->dimensions['width'], $this->dimensions['height']);
        }
-       
+
        // ###################################################################
        /**
        * Sets whether or not a legend is created for the graph
@@ -240,7 +240,7 @@ class Graph_Pie
        {
                $this->legend = (bool)$yesno;
        }
-       
+
        // ###################################################################
        /**
        * Sets the title of the chart to be drawn above the graph
@@ -253,7 +253,7 @@ class Graph_Pie
        {
                $this->title = $title;
        }
-       
+
        // ###################################################################
        /**
        * Adds an entry to the data set without specifying a colour to add.
@@ -269,7 +269,7 @@ class Graph_Pie
        {
                $this->dataset[] = array($name, intval($percent), $this->fetch_colour());
        }
-       
+
        // ###################################################################
        /**
        * Adds an entry ot the data set with specifying a colour. This works
@@ -286,7 +286,7 @@ class Graph_Pie
        {
                $this->dataset[] = array($name, intval($percent), imagecolorallocate($this->image, $colour[0], $colour[1], $colour[2]));
        }
-       
+
        // ###################################################################
        /**
        * Fetches a colour from the allocated colour list and returns the value
@@ -312,10 +312,10 @@ class Graph_Pie
                        array(45,       130,    195)
                );
                static $allocated = 0;
-               
+
                $colour = $colourlist["$allocated"];
                $allocated++;
-               
+
                return imagecolorallocate($this->image, $colour[0], $colour[1], $colour[2]);
        }
 }
index a772e96d73755e17cffbf0887bbe5be14095db15..031be4f3036a5d7aba065293216daea0a01b0fc8 100644 (file)
@@ -42,10 +42,10 @@ function page_start()
 <head>
        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
        <title><?php echo $GLOBALS['isso:callback']->getApplication(); ?> Installer</title>
-       
+
        <style type="text/css">
        <!--
-<?php echo $css; ?>    
+<?php echo $css; ?>
        //-->
        </style>
 </head>
@@ -58,7 +58,7 @@ function page_start()
 /**
 * Creates the end of the page and the "Next" button. The "Next" button
 * reqires that STOP_MARK be defined to be the total number of steps,
-* ACTIVE_SITE to be the page to link to for the next button, and 
+* ACTIVE_SITE to be the page to link to for the next button, and
 * STOP_LINK to be an <a> for when all the steps have been reached.
 *
 * @access      public
@@ -78,13 +78,13 @@ function page_end($next = true)
                        echo '<div class="buttonlink"><a href="' . ACTIVE_SITE . '?mark=' . ($GLOBALS['isso:callback']->in['mark'] + 1) . '">Next Step</a></div>';
                }
        }
-       
+
        echo '
 
 </body>
 
 </html>';
-       
+
        exit;
 }
 
index c797b6c5514b59afbe6f29ade02a276e992e2e8c..132506bbff0d55795507e97a5c90449e76025ce8 100644 (file)
@@ -164,7 +164,7 @@ define('REQ_NO', 0);
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class ISSO
 {
@@ -174,70 +174,70 @@ class ISSO
        * @access       private
        */
        var $sourcepath = '';
-       
+
        /**
        * Path of the current application
        * @var  string
        * @access       private
        */
        var $apppath = '';
-       
+
        /**
        * Web path used to get the web location of the installation of ISSO; only used for Printer module
        * @var  string
        * @access       private
        */
        var $webpath = '';
-       
+
        /**
        * Name of the current application
        * @var  string
        * @access       private
        */
        var $application = '';
-       
+
        /**
        * Version of the current application
        * @var  string
        * @access       private
        */
        var $appversion = '';
-       
+
        /**
        * Whether debug mode is on or off
        * @var  bool
        * @access       private
        */
        var $debug = false;
-       
+
        /**
        * List of all active debug messages
        * @var  array
        * @access       private
        */
        var $debuginfo = array();
-       
+
        /**
        * List of loaded modules
        * @var  array
        * @access       private
        */
        var $modules = array();
-       
+
        /**
        * An array of sanitized variables that have been cleaned for HTML tag openers and double quotes
        * @var  array
        * @access       public
        */
        var $in = array();
-       
+
        /**
        * If we are running with magic_quotes_gpc on or off
        * @var  int
        * @access       private
        */
        var $magicquotes = 0;
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -245,34 +245,34 @@ class ISSO
        function __construct()
        {
                $GLOBALS['isso:callback'] = null;
-               
+
                // error reporting
                set_error_handler(array(&$this, '_error_handler'));
-               
+
                // magic quotes
                $this->magicquotes = get_magic_quotes_gpc();
                set_magic_quotes_runtime(0);
-               
+
                // some debug info that's always useful
                $this->debug('magic_quotes_gpc = ' . $this->magicquotes);
                $this->debug('register_globals = ' . ini_get('register_globals'));
-               
+
                // attempt to set the sourcepath
                $path = call_user_func('debug_backtrace');
                $this->setSourcePath(str_replace('kernel.php', '', $path[0]['file']));
-               
+
                // start input sanitize using variable_order GPC
                if (!defined('ISSO_NO_INPUT_SANITIZE'))
                {
                        $this->exec_sanitize_data();
                }
-               
+
                if (defined('ISSO_CHECK_POST_REFERER'))
                {
                        $this->exec_referer_check();
                }
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -281,7 +281,7 @@ class ISSO
        {
                $this->__construct();
        }
-       
+
        // ###################################################################
        /**
        * Sets the sourcepath
@@ -294,7 +294,7 @@ class ISSO
        {
                $this->sourcepath = $this->fetch_sourcepath($path);
        }
-       
+
        // ###################################################################
        /**
        * Gets the sourcepath
@@ -307,7 +307,7 @@ class ISSO
        {
                return $this->sourcepath;
        }
-       
+
        // ###################################################################
        /**
        * Sets the apppath
@@ -320,7 +320,7 @@ class ISSO
        {
                $this->apppath = $this->fetch_sourcepath($path);
        }
-       
+
        // ###################################################################
        /**
        * Gets the apppath
@@ -333,7 +333,7 @@ class ISSO
        {
                return $this->apppath;
        }
-       
+
        // ###################################################################
        /**
        * Sets the webpath
@@ -346,7 +346,7 @@ class ISSO
        {
                $this->webpath = $this->fetch_sourcepath($path);
        }
-       
+
        // ###################################################################
        /**
        * Gets the webpath
@@ -359,7 +359,7 @@ class ISSO
        {
                return $this->webpath;
        }
-       
+
        // ###################################################################
        /**
        * Sets the applicaiton
@@ -372,7 +372,7 @@ class ISSO
        {
                $this->application = $app;
        }
-       
+
        // ###################################################################
        /**
        * Gets the application
@@ -385,7 +385,7 @@ class ISSO
        {
                return $this->application;
        }
-       
+
        // ###################################################################
        /**
        * Sets the appverison
@@ -398,7 +398,7 @@ class ISSO
        {
                $this->appversion = $version;
        }
-       
+
        // ###################################################################
        /**
        * Gets the appversion
@@ -411,7 +411,7 @@ class ISSO
        {
                return $this->appversion;
        }
-       
+
        // ###################################################################
        /**
        * Sets debug mode
@@ -424,7 +424,7 @@ class ISSO
        {
                $this->debug = $debug;
        }
-       
+
        // ###################################################################
        /**
        * Gets debug mode state
@@ -437,7 +437,7 @@ class ISSO
        {
                return $this->debug;
        }
-       
+
        // ###################################################################
        /**
        * Prepares a path for being set as the sourcepath
@@ -456,7 +456,7 @@ class ISSO
                }
                return $source;
        }
-       
+
        // ###################################################################
        /**
        * Loads a framework module
@@ -477,17 +477,17 @@ class ISSO
                        $GLOBALS['isso:callback'] =& $this;
                        $this->modules['isso'] =& $this;
                }
-               
+
                if ($this->is_loaded($framework))
                {
                        return $this->modules["$framework"];
                }
-               
+
                if ($this->sourcepath == '')
                {
                        trigger_error('Invalid sourcepath specified', E_USER_ERROR);
                }
-               
+
                if (file_exists($this->sourcepath . $framework . '.php'))
                {
                        require_once($this->sourcepath . $framework . '.php');
@@ -496,35 +496,35 @@ class ISSO
                {
                        trigger_error('Could not find the framework ' . $this->sourcepath . $framework . '.php', E_USER_ERROR);
                }
-               
+
                if ($asobject === null)
                {
                        return;
                }
-               
+
                if (isset($this->$asobject))
                {
                        trigger_error('Cannot instantiate framework `' . $framework . '` into `' . $asobject . '`', E_USER_ERROR);
                }
-               
+
                $this->$asobject = new $framework($this);
-               
+
                $this->modules["$framework"] =& $this->$asobject;
-               
+
                if ($globalize)
                {
                        $GLOBALS["$asobject"] =& $this->$asobject;
                }
-               
+
                // allow for init_as_package to link
                if (method_exists($this->modules["$framework"], 'init_as_package'))
                {
                        $this->modules[ $this->modules["$framework"]->init_as_package() ] =& $this->modules["$framework"];
                }
-               
+
                return $this->$asobject;
        }
-       
+
        // ###################################################################
        /**
        * Prints a list of all currently loaded framework modules
@@ -545,7 +545,7 @@ class ISSO
                        {
                                $module = $object->init_as_package() . " - ($module)";
                        }
-                       
+
                        $modules[] = $module;
                }
 
@@ -561,7 +561,7 @@ class ISSO
                        $this->message('Loaded Modules', $output, 1);
                }
        }
-       
+
        // ###################################################################
        /**
        * Verifies to see if a framework has been loaded
@@ -583,7 +583,7 @@ class ISSO
                        return false;
                }
        }
-       
+
        // ###################################################################
        /**
        * Prints an ISSO message
@@ -609,37 +609,37 @@ class ISSO
                                $color = '#669900';
                                $font = '#000000';
                        break;
-                       
+
                        // Warning
                        case 2:
                                $prefix = 'Warning';
                                $color = '#003399';
                                $font = '#FFFFFF';
                        break;
-                       
+
                        case 3:
                                $prefix = 'Error';
                                $color = '#990000';
                                $font = '#EFEFEF';
                        break;
                }
-               
+
                $backtrace = debug_backtrace();
                array_shift($backtrace);
-               
+
                if (isset($backtrace[0]) AND $backtrace[0]['function'] == '_error_handler')
                {
                        array_shift($backtrace);
                }
-               
+
                $trace = $this->format_debug_trace($backtrace);
-       
+
                $output = "\n<br />\n<table cellpadding=\"4\" cellspacing=\"1\" border=\"0\" width=\"$width\" style=\"background-color: $color; color: black; font-family: Verdana, sans-serif; font-size: 12px;\">";
                $output .= "\n<tr style=\"color: $font; text-align: left\">\n\t<td><strong>$prefix: $title</strong></td>\n</tr>";
                $output .= "\n<tr style=\"background-color: #FFFFFF; text-align: left\">\n\t<td>$message</td>\n</tr>";
                $output .= (($stack AND $GLOBALS['isso:callback']->debug) ? "\n<tr style=\"background-color: #FFFFFF; text-align: left\">\n\t<td><strong>Debug Stack:</strong> <pre>" . implode("\n", $trace) . "</pre></td>\n</tr>" : '');
                $output .= "\n</table>\n<br />\n";
-               
+
                if ($return)
                {
                        return $output;
@@ -649,7 +649,7 @@ class ISSO
                        print($output);
                }
        }
-       
+
        // ###################################################################
        /**
        * Prepares a debug_backtrace() array for output to the browser by
@@ -669,7 +669,7 @@ class ISSO
                        $args = '';
                        $file = $step['file'] . ':' . $step['line'];
                        $funct = (isset($step['class']) ? $step['class'] . '::' . $step['function'] : $step['function']);
-                       
+
                        if (isset($step['args']) AND is_array($step['args']))
                        {
                                // we need to do this so we don't get "Array to string conversion" notices
@@ -682,13 +682,13 @@ class ISSO
                                }
                                $args = implode(', ', $step['args']);
                        }
-       
-                       $trace[] = "#$i  $funct($args) called at [$file]"; 
+
+                       $trace[] = "#$i  $funct($args) called at [$file]";
                }
-               
+
                return $trace;
        }
-       
+
        // ###################################################################
        /**
        * Custom error handler for ISSO; only handle E_WARNING, E_NOTICE,
@@ -705,7 +705,7 @@ class ISSO
        function _error_handler($errno, $errstr, $errfile, $errline, $errcontext)
        {
                $level = ini_get('error_reporting');
-               
+
                switch ($errno)
                {
                        // Fatal
@@ -717,7 +717,7 @@ class ISSO
                                        return;
                                }
                        break;
-                       
+
                        // Error
                        case E_USER_WARNING:
                        case E_WARNING:
@@ -728,7 +728,7 @@ class ISSO
                                        return;
                                }
                        break;
-                       
+
                        // Warning
                        case E_USER_NOTICE:
                        case E_NOTICE:
@@ -741,19 +741,19 @@ class ISSO
                                }
                        break;
                }
-               
+
                $errstr .= " in <strong>$errfile</strong> on line <strong>$errline</strong>";
 
                $errstr = str_replace(array(getcwd(), dirname(getcwd())), '', $errstr);
-               
+
                $this->message($title, $errstr, $mode);
-               
+
                if ($errno == E_USER_ERROR)
                {
                        exit;
                }
        }
-       
+
        // ###################################################################
        /**
        * Creates a table that explains the error reporting levels and their
@@ -778,9 +778,9 @@ class ISSO
                        'E_ALL'                         => E_ALL,
                        'E_STRICT'                      => 2048
                );
-               
+
                $table = '<table cellspacing="0" cellpadding="2" border="0">';
-               
+
                foreach ($levels AS $name => $value)
                {
                        $table .= '
@@ -789,13 +789,13 @@ class ISSO
                                <td>' . (ini_get('error_reporting') & $value) . '</td>
                        </tr>';
                }
-               
+
                $table .= '
                </table>';
-               
+
                $this->message('Error Reporting', $table, 1);
        }
-       
+
        // ###################################################################
        /**
        * Logs a debug message for verbose output
@@ -808,7 +808,7 @@ class ISSO
        {
                $this->debuginfo[] = $message;
        }
-       
+
        // ###################################################################
        /**
        * Recursive XSS cleaner
@@ -838,7 +838,7 @@ class ISSO
                }
                return $data;
        }
-       
+
        // ###################################################################
        /**
        * Simple way to protect against HTML attacks with Unicode support
@@ -860,7 +860,7 @@ class ISSO
                        return str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $text);
                }
        }
-       
+
        // ###################################################################
        /**
        * Unicode-safe entity encoding system; similar to sanitize()
@@ -877,7 +877,7 @@ class ISSO
                $text = $this->sanitize($text);
                return $text;
        }
-       
+
        // ###################################################################
        /**
        * Takes text that has been processed for HTML and unsanitizes it
@@ -892,7 +892,7 @@ class ISSO
        {
                return str_replace(array('&lt;', '&gt;', '&quot;'), array('<', '>', '"'), $text);
        }
-       
+
        // ###################################################################
        /**
        * Smart addslashes() that only applies itself it the Magic Quotes GPC
@@ -926,7 +926,7 @@ class ISSO
                        return addslashes($str);
                }
        }
-       
+
        // ###################################################################
        /**
        * Runs through all of the input data and sanitizes it.
@@ -937,7 +937,7 @@ class ISSO
        {
                $this->in = $this->_sanitize_input_recursive(array_merge($_GET, $_POST, $_COOKIE));
        }
-       
+
        // ###################################################################
        /**
        * Sanitize function for something other than a string (which
@@ -956,7 +956,7 @@ class ISSO
                        $this->input_clean($varname, $type);
                }
        }
-       
+
        // ###################################################################
        /**
        * Sanitize function that does a single variable as oppoesd to an array
@@ -977,10 +977,10 @@ class ISSO
                {
                        $this->in["$varname"] = $this->clean(null, $type);
                }
-               
+
                return $this->in["$varname"];
        }
-       
+
        // ###################################################################
        /**
        * Runs ISSO->escape() on a variable on ISSO->in[]. This is just a
@@ -1005,7 +1005,7 @@ class ISSO
                        return $this->escape(null);
                }
        }
-       
+
        // ###################################################################
        /**
        * Cleaning function that does the work for input_clean(); this is
@@ -1025,7 +1025,7 @@ class ISSO
                {
                        return $this->clean_array($value, $type);
                }
-               
+
                if ($type == TYPE_INT)
                {
                        $value = intval($value);
@@ -1069,10 +1069,10 @@ class ISSO
                {
                        trigger_error('Invalid clean type `' . $type . '` specified', E_USER_ERROR);
                }
-               
+
                return $value;
        }
-       
+
        // ###################################################################
        /**
        * Recursion function for ISSO->clean()
@@ -1090,10 +1090,10 @@ class ISSO
                {
                        $array["$key"] = $this->clean($value, $type);
                }
-               
+
                return $array;
        }
-       
+
        // ###################################################################
        /**
        * Checks to see if a POST refer is actually from us
@@ -1105,12 +1105,12 @@ class ISSO
                if ($_SERVER['REQUEST_METHOD'] == 'POST')
                {
                        $host = ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST'];
-                       
+
                        if ($host AND $_SERVER['HTTP_REFERER'])
                        {
                                $parts = parse_url($_SERVER['HTTP_REFERER']);
                                $ourhost = $parts['host'] . (isset($parts['port']) ? ":$parts[port]" : '');
-                               
+
                                if ($ourhost != $host)
                                {
                                        trigger_error('No external hosts are allowed to POST to this application', E_USER_ERROR);
@@ -1123,7 +1123,7 @@ class ISSO
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Constructs a debug information box that contains various debugging
@@ -1138,11 +1138,11 @@ class ISSO
        function construct_debug_block($dotemplates)
        {
                $debug = '';
-               
+
                if ($this->debug)
                {
                        $debug = "\n<ul>";
-                       
+
                        // templates
                        if ($dotemplates)
                        {
@@ -1156,20 +1156,20 @@ class ISSO
                                        }
                                        $usage[] = $name . " ($count)";
                                }
-                               
+
                                $sizeof = sizeof($this->modules['template']->uncached);
                                if ($sizeof > 0)
                                {
                                        $debug .= "\n\t<li><strong style=\"color: red\">Uncached Template(s):</strong> $sizeof ( " . implode(' &nbsp; ', $optlist) . " )</li>";
                                }
                        }
-                       
+
                        // source control
                        $scinfo = 'Not Under Source Control';
                        if (defined('SVN'))
                        {
                                $scinfo = constant('SVN');
-                               
+
                                if (preg_match('#\$Id:?\s*\$#', $scinfo))
                                {
                                        $scinfo = 'Not Under Source Control';
@@ -1181,15 +1181,15 @@ class ISSO
                                        $scinfo = preg_replace('#\$' . 'Id: (.+?) ([0-9].+?) [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.+?) (.+?) \$#', '\\1 - SVN \\2', $scinfo);
                                }
                        }
-                       
-                       $scinfo = trim($scinfo);                        
+
+                       $scinfo = trim($scinfo);
                        $debug .= "\n\t<li><strong>Source Control:</strong> $scinfo</li>";
-                       
+
                        // query information
                        if (is_object($this->modules[ISSO_DB_LAYER]))
                        {
                                $debug .= "\n\t<li><strong>Total Queries:</strong> " . sizeof($this->modules[ISSO_DB_LAYER]->history) . " (<a href=\"" . $this->sanitize($_SERVER['REQUEST_URI']) . ((strpos($_SERVER['REQUEST_URI'], '?') !== false) ? '&amp;query=1' : '?query=1') . "\">?</a>)</li>";
-                               
+
                                $queries = $this->modules[ISSO_DB_LAYER]->history;
                                $querydebug = "<br />\n" . '<table cellpadding="4" cellspacing="1" border="0" align="center" width="30%" style="background-color: rgb(60, 60, 60); color: white">' . "\n\t" . '<tr><td><strong>Query Debug</strong></td></tr>';
                                foreach ($queries AS $query)
@@ -1198,17 +1198,17 @@ class ISSO
                                        $querydebug .= "\n\t\t<td>";
                                        $querydebug .= "\n\t\t\t$query[query]\n\n\t\t\t<div style=\"font-size: 9px;\">($query[time])</div>\n<!--\n" . implode("\n", $query[trace]) . "\n-->\n\t\t</td>\n\t</tr>";
                                }
-                               
+
                                $querydebug .= "\n</table>\n\n\n";
                        }
-                       
+
                        // total execution time
                        if (defined('ISSO_MT_START'))
                        {
                                $this->load('functions', 'functions');
                                $debug .= "\n\t<li><strong>Total Execution Time:</strong> " . round($this->modules['functions']->fetch_microtime_diff(ISSO_MT_START), 10) . "</li>";
                        }
-                       
+
                        // debug notices
                        $debug .= "\n\t<li>\n\t\t<select>\n\t\t\t<option>Debug Notices (" . sizeof($this->debuginfo) . ")</option>";
                        foreach ((array)$this->debuginfo AS $msg)
@@ -1216,7 +1216,7 @@ class ISSO
                                $debug .= "\n\t\t\t<option>--- $msg</option>";
                        }
                        $debug .= "\n\t\t</select>\n\t</li>";
-                       
+
                        // loaded modules
                        $modules = $this->show_modules(true);
                        $debug .= "\n\t<li>\n\t\t<select>\n\t\t\t<option>Loaded Modules (" . sizeof($modules) . ")</option>";
@@ -1225,7 +1225,7 @@ class ISSO
                                $debug .= "\n\t\t\t<option>--- $mod</option>";
                        }
                        $debug .= "\n\t\t</select>\n\t</li>";
-                       
+
                        // template usage
                        if ($dotemplates)
                        {
@@ -1236,12 +1236,12 @@ class ISSO
                                }
                                $debug .= "\n\t\t</select>\n\t</li>";
                        }
-                       
+
                        $debug .= "\n</ul>";
-                                               
+
                        $debug = "\n\n<!-- dev debug -->\n<div align=\"center\">\n\n<hr />\n" . $this->message('Debug Information', $debug, 1, true, false) . "\n</div>$querydebug\n<!-- / dev debug -->\n\n";
                }
-               
+
                return $debug;
        }
 }
index aa4d1276ecd17551a06deb2e91a3f2438b5f03e5..ea3b6481dace24a595ec7713db0c8d9f2766c284 100644 (file)
@@ -36,7 +36,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Mail
 {
@@ -46,70 +46,70 @@ class Mail
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * The subject of the message
        * @var  string
        * @access       private
        */
        var $subject = '';
-       
+
        /**
        * Body plain-text of the message
        * @var  string
        * @access       private
        */
        var $bodytext = '';
-       
+
        /**
        * HTML multi-part body of the message
        * @var  string
        * @access       private
        */
        var $bodyhtml = '';
-       
+
        /**
        * The message sender's email address
        * @var  string
        * @access       private
        */
        var $from = '';
-       
+
        /**
        * The message sender's display name
        * @var  string
        * @access       private
        */
        var $fromname = '';
-       
+
        /**
        * Additional message headers
        * @var  string
        * @access       private
        */
        var $headers = '';
-       
+
        /**
        * Whether to send the message as HTML or plain-text
        * @var  bool
        * @access       private
        */
        var $sendhtml = false;
-       
+
        /**
        * The new line delimiter used in the message
        * @var  string
        * @access       private
        */
        var $delim = "\n";
-       
+
        /**
        * Character set used to send messages with
        * @var  string
        * @access       public
        */
        var $charset = 'utf-8'; // should we be using iso-8859-1 ?
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -118,7 +118,7 @@ class Mail
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -127,7 +127,7 @@ class Mail
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Sets the subject
@@ -140,7 +140,7 @@ class Mail
        {
                $this->subject = $subject;
        }
-       
+
        // ###################################################################
        /**
        * Sets the body text (required)
@@ -153,7 +153,7 @@ class Mail
        {
                $this->bodytext = $body;
        }
-       
+
        // ###################################################################
        /**
        * Sets the HTML body (optional)
@@ -166,7 +166,7 @@ class Mail
        {
                $this->bodyhtml = $body;
        }
-       
+
        // ###################################################################
        /**
        * Sets the from address
@@ -179,7 +179,7 @@ class Mail
        {
                $this->from = $address;
        }
-       
+
        // ###################################################################
        /**
        * Sets the from display name
@@ -192,7 +192,7 @@ class Mail
        {
                $this->fromname = $name;
        }
-       
+
        // ###################################################################
        /**
        * Sets any additional headers
@@ -205,7 +205,7 @@ class Mail
        {
                $this->headers = $headers;
        }
-       
+
        // ###################################################################
        /**
        * Sets the character set to send the email in
@@ -218,7 +218,7 @@ class Mail
        {
                $this->charset = $charset;
        }
-               
+
        // ###################################################################
        /**
        * Sends an email to the specified address with the specified
@@ -239,7 +239,7 @@ class Mail
                        trigger_error('You need to specify an email address', E_USER_ERROR);
                        return false;
                }
-               
+
                // make sure we have a mailer
                // TODO - add support for SMTP
                if (!@ini_get('sendmail_path'))
@@ -247,7 +247,7 @@ class Mail
                        $this->registry->debug("email: no sendmail -> not sending");
                        return false;
                }
-               
+
                // sort out the to addresses
                $address = $this->_fetch_first_line($address);
                $address = trim($this->registry->unsanitize($address));
@@ -255,49 +255,49 @@ class Mail
                $name = trim($this->registry->unsanitize($name));
                $name = $this->_encodeHeaderValue($name);
                $tostring = ($name == null ?  $address : "\"$name\" <$address>");
-               
+
                // sanitize the from field
                $from = $this->_fetch_first_line($this->from);
                $from = trim($this->registry->unsanitize($from));
-               
+
                // sanitize the from name
                $fromname = $this->_fetch_first_line($this->fromname);
                $fromname = ($fromname == '' ? $from : trim($this->registry->unsanitize($fromname)));
                $fromname = $this->_encodeHeaderValue($this->fromname);
-               
+
                // sanitize the subject
                $subject = $this->_fetch_first_line($this->subject);
                $subject = trim($this->registry->unsanitize($subject));
                $subject = $this->_encodeHeaderValue($subject);
-               
+
                // sanitize the body
                $bodytext = $this->registry->modules['functions']->convert_line_breaks($this->bodytext, $this->delim);
                $bodytext = trim($this->registry->unsanitize($bodytext, true));
-               
+
                // attach additional headers
                $headers = $this->registry->modules['functions']->convert_line_breaks($this->headers, $this->delim);
                $headers .= ((!preg_match("#{$this->delim}$#", $headers) AND $headers != '') ? "\n" : '') . "From: \"{$fromname}\" <{$from}>" . $this->delim;
                $headers .= "Return-Path: {$from}" . $this->delim;
                $headers .= "X-Mailer: ISSO Mail Framework \$Revision$" . $this->delim;
                $headers .= "MIME-Version: 1.0" . $this->delim;
-               
+
                // see if we need to use mime/multipart
                if ($sendhtml AND !empty($bodyhtml) == true)
                {
                        $boundary = 'ISSO-MULTIPART-' . $this->registry->modules['functions']->rand(10);
                        $headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\"" . $this->delim;
-                       
+
                        $bodyhtml = $this->registry->modules['functions']->convert_line_breaks($this->bodyhtml, $this->delim);
-                       
+
                        // first part of the message (plaintext)
                        $body = "--$boundary" . $this->delim;
                        $body .= "Content-Type: text/plain; charset=\"" . $this->charset . "\"" . $this->delim;
                        $body .= "Content-Transfer-Encoding: 8bit" . $this->delim . $this->delim;
                        $body .= $bodytext . $this->delim;
-                       
+
                        // add some space between the parts
                        $body .= $this->delim . $this->delim . $this->delim;
-                       
+
                        // second part (html)
                        $body .= "--$boundary" . $this->delim;
                        $body .= "Content-Type: text/html; charset=\"" . $this->charset . "\"" . $this->delim;
@@ -312,9 +312,9 @@ class Mail
                        $body = $bodytext;
                }
                $headers .= "Content-Transfer-Encoding: 8bit" . $this->delim;
-                
+
                $headers = trim($headers);
-               
+
                // attempt to send the mail!
                if (mail($tostring, $subject, $body, $headers, "-f {$from}"))
                {
@@ -325,7 +325,7 @@ class Mail
                        $this->registry->debug("email: error sending to $address");
                }
        }
-       
+
        // ###################################################################
        /**
        * Fetches the first line of a string
@@ -342,7 +342,7 @@ class Mail
                $broken = explode("\n", $string);
                return $broken[0];
        }
-       
+
        // ###################################################################
        /**
        * Encodes a header value (to name, fron name, subject, etc.) according
@@ -358,12 +358,12 @@ class Mail
                {
                        return $text;
                }
-               
+
                // perform this on non-ASCII characters; excluding _ and = because we want them to be encoded as they have
                // different meanings in mail messages
                $text = preg_replace('#([^a-zA-Z0-9\+\-\*!/])#e', '"=" . strtoupper(dechex(ord("\\1")))', $text);
                $text = str_replace('=20', '_' , $text);
-               
+
                return '=?' . $this->charset . '?q?' . $text . '?=';
        }
 }
index 937d518d03f67bcde904d46b39375da8a8ca1532..d5892dd6cf6e5e5490041c10c44a9a968511ccde 100644 (file)
@@ -42,7 +42,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Pagination
 {
@@ -52,77 +52,77 @@ class Pagination
        * @access       private
        */
        var $page;
-       
+
        /**
        * Per-page value
        * @var  integer
        * @access       private
        */
        var $perpage;
-       
+
        /**
        * Number of page links
        * @var  integer
        * @access       private
        */
        var $pagelinks;
-       
+
        /**
        * Total number of results
        * @var  integer
        * @access       private
        */
        var $total;
-       
+
        /**
        * Total number of pages
        * @var  integer
        * @access       private
        */
        var $pagecount;
-       
+
        /**
        * Name of page variable
        * @var  array
        * @access       private
        */
        var $pagevar;
-       
+
        /**
        * Name of per-page variable
        * @var  integer
        * @access       private
        */
        var $perpagevar;
-       
+
        /**
        * Maximum number of per-page results
        * @var  integer
        * @access       private
        */
        var $maxperpage = 100;
-       
+
        /**
        * Default number of per-page results
        * @var  integer
        * @access       private
        */
        var $defaultperpage = 20;
-       
+
        /**
        * The processing callback function for individual pagenav bits
        * @var string
        * @access       private
        */
        var $bitprocessor = ':undefined:';
-       
+
        /**
        * The processing callback function for the entire pagenav system
        * @var string
        * @access       private
        */
        var $pagenavprocessor = ':undefined:';
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -131,7 +131,7 @@ class Pagination
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -140,7 +140,7 @@ class Pagination
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Callback function for the processing of an indivdual page. Needs
@@ -155,7 +155,7 @@ class Pagination
        {
                $this->bitprocessor = $callback;
        }
-       
+
        // ###################################################################
        /**
        * Callback function for the processing the entire page navigator. Needs
@@ -170,7 +170,7 @@ class Pagination
        {
                $this->pagenavprocessor = $callback;
        }
-       
+
        // ###################################################################
        /**
        * Returns the current page number
@@ -183,7 +183,7 @@ class Pagination
        {
                return $this->page;
        }
-       
+
        // ###################################################################
        /**
        * Returns the current perpage value
@@ -196,7 +196,7 @@ class Pagination
        {
                return $this->perpage;
        }
-       
+
        // ###################################################################
        /**
        * Sets total
@@ -209,7 +209,7 @@ class Pagination
        {
                $this->total = $total;
        }
-       
+
        // ###################################################################
        /**
        * Returns the number of pages to be in the navigator
@@ -222,7 +222,7 @@ class Pagination
        {
                return $this->pagecount;
        }
-       
+
        // ###################################################################
        /**
        * Sets pagelinks
@@ -235,7 +235,7 @@ class Pagination
        {
                $this->pagelinks = $pagelinks;
        }
-       
+
        // ###################################################################
        /**
        * Sets pagevar
@@ -248,7 +248,7 @@ class Pagination
        {
                $this->pagevar = $pagevar;
        }
-       
+
        // ###################################################################
        /**
        * Sets perpagevar
@@ -261,7 +261,7 @@ class Pagination
        {
                $this->perpagevar = $perpagevar;
        }
-       
+
        // ###################################################################
        /**
        * Sets maxperpage
@@ -274,7 +274,7 @@ class Pagination
        {
                $this->maxperpage = $maxperpage;
        }
-       
+
        // ###################################################################
        /**
        * Sets defaultperpage
@@ -287,8 +287,8 @@ class Pagination
        {
                $this->defaultperpage = $defaultperpage;
        }
-       
-       
+
+
        // ###################################################################
        /**
        * Takes all of the information from the set() functions and then
@@ -318,7 +318,7 @@ class Pagination
 
                $this->perpage = $this->registry->clean($this->perpage, TYPE_INT);
        }
-       
+
        // ###################################################################
        /**
        * Takes the variables and splits up the pages
@@ -333,7 +333,7 @@ class Pagination
                        $this->pagelinks = $this->pagecount;
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns the lower limit of the pages
@@ -350,9 +350,9 @@ class Pagination
                {
                        $page = $this->page;
                }
-               
+
                $limit = $page * $this->perpage;
-               
+
                if ($page < 1)
                {
                        $page = 1;
@@ -363,7 +363,7 @@ class Pagination
                        $page = $this->pagecount - 1;
                        $limit = $this->total;
                }
-               
+
                if ($limit < 0)
                {
                        return 0;
@@ -377,7 +377,7 @@ class Pagination
                        return $limit;
                }
        }
-       
+
        // ###################################################################
        /**
        * Constructs the page navigator
@@ -391,7 +391,7 @@ class Pagination
        function constructPageNav($baselink)
        {
                global $bugsys;
-               
+
                // handle base link
                if (strpos($baselink, '?') === false)
                {
@@ -401,63 +401,63 @@ class Pagination
                {
                        $baselink .= '&amp;';
                }
-               
+
                // first page number in page nav
                $startpage = $this->page - $this->pagelinks;
                if ($startpage < 1)
                {
                        $startpage = 1;
                }
-               
+
                // last page number in page nav
                $endpage = $this->page + $this->pagelinks;
                if ($endpage > $this->pagecount)
                {
                        $endpage = $this->pagecount;
                }
-               
+
                // prev page in page nav
                $prevpage = $this->page - 1;
                if ($prevpage < 1)
                {
                        $prevpage = 1;
                }
-               
+
                // next page in page nav
                $nextpage = $this->page + 1;
                if ($nextpage > $this->pagecount)
                {
                        $nextpage = $this->pagecount;
                }
-               
+
                // show the prev page
                $show['prev'] = true;
                if ($this->page == $startpage)
                {
                        $show['prev'] = false;
                }
-               
+
                // show the next page
                $show['next'] = true;
                if ($this->page == $endpage)
                {
                        $show['next'] = false;
                }
-               
+
                // show the first page
                $show['first'] = false;
                if ($startpage > 1)
                {
                        $show['first'] = true;
                }
-               
+
                // show the last page
                $show['last'] = false;
                if ($endpage < $this->pagecount)
                {
                        $show['last'] = true;
                }
-               
+
                // construct the page bits
                $bits = '';
                $call = $this->bitprocessor;
@@ -471,10 +471,10 @@ class Pagination
                        {
                                $nolink = false;
                        }
-                       
+
                        $bits .= $call($baselink, $nolink, $i, $this);
                }
-                               
+
                $call = $this->pagenavprocessor;
                return $call($baselink, $nextpage, $prevpage, $show, $bits, $this);
        }
index 572173d6ffd4ddcee3f83a6e06964d8306cc18b9..1357a8f887213850362e47b31ddedc73e7c6eb81 100644 (file)
@@ -72,9 +72,9 @@ html
 body
 {
        color: rgb(96, 106, 90);
-       
+
        background-color: rgb(232, 255, 198);
-       
+
        padding: 15px;
 }
 
@@ -88,7 +88,7 @@ body
 .tcat
 {
        color: rgb(30, 35, 46);
-       
+
        background-color: rgb(109, 187, 45);
 }
 
@@ -102,10 +102,10 @@ body
 td.thead, .thead td, .alt3
 {
        color: rgb(45, 45, 45);
-       
+
        font-weight: bold;
        font-size: 11px;
-       
+
        background-color: rgb(165, 165, 165);
 }
 
@@ -119,7 +119,7 @@ td.thead, .thead td, .alt3
 .alt1
 {
        color: rgb(41, 63, 91);
-       
+
        background-color: rgb(237, 245, 230);
 }
 
@@ -127,7 +127,7 @@ td.thead, .thead td, .alt3
 .alt2
 {
        color: rgb(41, 63, 91);
-       
+
        background-color: rgb(255, 255, 255);
 }
 
@@ -141,7 +141,7 @@ td.thead, .thead td, .alt3
 .tfoot
 {
        color: rgb(55, 55, 55);
-       
+
        background-color: rgb(64, 64, 64);
 }
 
@@ -216,9 +216,9 @@ input, textarea, select, option
 {
        font-family: tahoma, verdana, geneva, arial, helvetica, sans-serif;
        font-size: 11px;
-       
+
        text-indent: 5px;
-       
+
        margin: 3px 1px 1px 1px;
 }
 
@@ -226,11 +226,11 @@ input, textarea, select, option
 .button
 {
        color: rgb(0, 0, 0);
-       
+
        font-family: tahoma, verdana, geneva, arial, helvetica, sans-serif;
        font-size: 11px;
        font-weight: bold;
-       
+
        margin: 3px 1px 1px 1px;
 }
 
@@ -242,7 +242,7 @@ input, textarea, select, option
 #toplinks
 {
        float: right;
-       
+
        font-size: 14px;
 }
 
@@ -261,15 +261,15 @@ input, textarea, select, option
 #contentbody
 {
        padding: 5px;
-       
+
        background-color: rgb(255, 255, 255);
-       
+
        border-color: rgb(124, 128, 135);
        border-width: 1px;
        border-style: solid;
-       
+
        color: rgb(55, 55, 55);
-       
+
        width: 100%;
 }
 
@@ -277,9 +277,9 @@ input, textarea, select, option
 #tabbar
 {
        height: 35px;
-       
+
        padding-left: 10px;
-       
+
        margin-top: 10px;
        margin-bottom: -14px;
 }
@@ -289,13 +289,13 @@ input, textarea, select, option
 {
        font-weight: bold;
        color: rgb(122, 151, 101);
-       
+
        text-transform: uppercase;
        text-decoration: none;
-       
+
        padding: 8px 0px 8px 0px;
        margin: 0px;
-       
+
        background-image: url({$GLOBALS['isso:callback']->webpath}images/tabs.gif);
        background-repeat: no-repeat;
        background-position: 0% -35px;
@@ -306,9 +306,9 @@ input, textarea, select, option
 {
        height: 33px;
        width: 100%;
-       
+
        padding: 8px 15px 8px 15px;
-       
+
        background-image: url({$GLOBALS['isso:callback']->webpath}images/tabs-ends.gif);
        background-repeat: no-repeat;
        background-position: 100% -35px;
@@ -318,9 +318,9 @@ input, textarea, select, option
 #tabbar #focustab, #tabbar #focustab a:hover
 {
        color: rgb(64, 64, 64);
-       
+
        background-position: 0% 0px;
-       
+
        padding: 8px 0px 9px 0px;
 }
 
@@ -328,7 +328,7 @@ input, textarea, select, option
 #tabbar #focustab span
 {
        background-position: 100% 0px;
-       
+
        padding-bottom: 9px;
 }
 
@@ -336,7 +336,7 @@ input, textarea, select, option
 #tabbar a:hover
 {
        background-position: 0% -70px;
-       
+
        color: rgb(143, 236, 9);
 }
 
@@ -350,9 +350,9 @@ input, textarea, select, option
 #mainbody
 {
        width: 80%;
-       
+
        vertical-align: top;
-       
+
        padding: 5px 5px 5px 0px;
 }
 
@@ -365,9 +365,9 @@ input, textarea, select, option
 #menu
 {
        width: 20%;
-       
+
        padding: 15px;
-       
+
        vertical-align: top;
 }
 
@@ -375,7 +375,7 @@ input, textarea, select, option
 #menu ul
 {
        list-style: none;
-       
+
        padding: 0px;
        margin: 0px;
 }
@@ -384,10 +384,10 @@ input, textarea, select, option
 #menu li span
 {
        display: block;
-       
+
        padding: 2px 2px 2px 7px;
        margin-top: 1px;
-       
+
        background-color: rgb(208, 208, 208);
 }
 
@@ -412,9 +412,9 @@ input, textarea, select, option
        font-weight: bold;
        text-transform: uppercase;
        color: rgb(255, 255, 255);
-       
+
        padding: 3px;
-       
+
        background-color: rgb(96, 106, 90);
 }
 
@@ -422,7 +422,7 @@ input, textarea, select, option
 #menu li.focus span
 {
        background-color: rgb(182, 216, 154);
-       
+
        text-decoration: underline;
 }
 
index 8d9b997027e5cb85c2d5d0ca761ff525f5024a66..8283c183b89330403dfaf311b037bf7f826ccaac 100644 (file)
@@ -43,7 +43,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Printer
 {
@@ -53,42 +53,42 @@ class Printer
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * Realm that we are operating in (displayed in the <title>)
        * @var  string
        * @access       private
        */
        var $realm = '[UNDEFINED REALM]';
-       
+
        /**
        * CSS to place in the page
        * @var  string
        * @access       private
        */
        var $css = '';
-       
+
        /**
        * Extra code to place
        * @var  sring
        * @access       private
        */
        var $code = '';
-       
+
        /**
        * Page-start hooko
        * @var  string
        * @access       private
        */
        var $page_start_hook = ':=NO METHOD=:';
-       
+
        /**
        * Language information array: ('langcode' =>, 'direction' =>, 'charset' =>)
        * @var  array
        * @access       private
        */
        var $language = array('langcode' => 'en_US', 'direction' => 'ltr', 'charset' => 'utf-8');
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -97,7 +97,7 @@ class Printer
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -106,7 +106,7 @@ class Printer
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Sets the realm
@@ -119,7 +119,7 @@ class Printer
        {
                $this->realm = $realm;
        }
-       
+
        // ###################################################################
        /**
        * Gets the realm
@@ -132,7 +132,7 @@ class Printer
        {
                return $this->realm;
        }
-       
+
        // ###################################################################
        /**
        * Gets the language array information
@@ -142,10 +142,10 @@ class Printer
        * @return       array   Language array
        */
        function getLanguageInformation()
-       {               
+       {
                return $this->language;
        }
-       
+
        // ###################################################################
        /**
        * Sets the language array information
@@ -155,10 +155,10 @@ class Printer
        * @param        array   Language array
        */
        function setLanguageInformation($lang)
-       {               
+       {
                $this->language = $lang;
        }
-       
+
        // ###################################################################
        /**
        * Creates a redirect to another page; constructs the header and footer
@@ -173,14 +173,14 @@ class Printer
        function redirect($location, $message = null, $postvars = array())
        {
                $timeout = 10 * 200;
-               
+
                if ($postvars)
                {
                        $js = <<<JS
        <script type="text/javascript">
        <!--
                var timeout = $timeout;
-               
+
                if (timeout > 0)
                {
                        setTimeout("redirect()", $timeout);
@@ -194,7 +194,7 @@ class Printer
                {
                        document.forms.postvars.submit();
                }
-               
+
        //-->
        </script>
 JS;
@@ -205,7 +205,7 @@ JS;
        <script type="text/javascript">
        <!--
                var timeout = $timeout;
-               
+
                if (timeout > 0)
                {
                        setTimeout("redirect()", $timeout);
@@ -214,7 +214,7 @@ JS;
                {
                        redirect();
                }
-               
+
                function redirect()
                {
                        window.location = "$location";
@@ -223,26 +223,26 @@ JS;
        </script>
 JS;
                }
-               
+
                if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
                {
                        define('ISSO_PRINTER_NO_NAVIGATION', 1);
                }
-               
+
                $this->page_start(T('Redirect'));
-               
+
                if ($postvars)
                {
                        $this->form_start($location, null, false, 'postvars');
-                       
+
                        foreach ($postvars AS $key => $value)
                        {
                                $this->form_hidden_field($key, $value);
                        }
-                       
+
                        $this->form_end();
                }
-               
+
                $redir = sprintf(T('Please wait to be redirected. If you are not redirected in a few seconds, click <a href="%1$s">here</a>.'), $location);
                $override = false;
                if ($message == null)
@@ -255,14 +255,14 @@ JS;
                        $showmessage .= "\n<p>" . $redir . "</p>";
                        $override = true;
                }
-               
+
                $this->page_message(T('Redirect'), $showmessage, $override);
-               
+
                $this->page_code($js);
-               
+
                $this->page_end();
        }
-       
+
        // ###################################################################
        /**
        * Throws a fatal error; constructs the header and footer
@@ -277,14 +277,14 @@ JS;
                {
                        define('ISSO_PRINTER_NO_NAVIGATION', 1);
                }
-               
+
                $this->page_start(T('Error'));
                $this->page_message(T('Error'), $message);
                $this->page_end();
-               
+
                exit;
        }
-       
+
        // ###################################################################
        /**
        * Outputs the header of the page: doctype, <html>, <head>, <title>,
@@ -303,14 +303,14 @@ JS;
                {
                        ob_start();
                }
-               
+
                if (defined('ISSO_PRINTER_DONE_HEADER') AND constant('ISSO_PRINTER_DONE_HEADER'))
                {
                        return;
                }
-               
+
                $title = sprintf(T('%1$s - %2$s - %3$s'), $this->registry->getApplication(), $this->realm, $actiontitle);
-               
+
                echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
                echo "<html xml:lang=\"" . $this->language['langcode'] . "\" lang=\"" . $this->language['langcode'] . "\" dir=\"" . $this->language['direction'] . "\">\n<head>";
                echo "\n\t<title>$title</title>";
@@ -319,18 +319,18 @@ JS;
                echo $this->code;
                echo ($extra ? "\n$extra" : '');
                echo "\n</head>\n<body" . ($pageclass != null ? " class=\"$pageclass\"" : '') . ($onload ? " onload=\"$onload\"" : '') . ">\n";
-               
+
                if ($this->registry->is_loaded('printer_navigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR (defined('ISSO_PRINTER_NO_NAVIGATION') AND constant('ISSO_PRINTER_NO_NAVIGATION') != true)))
                {
                        echo $this->registry->modules['printer_navigation']->generate_header_html();
                }
-               
+
                if (!defined('ISSO_PRINTER_DONE_HEADER'))
                {
                        define('ISSO_PRINTER_DONE_HEADER', 1);
                }
        }
-       
+
        // ###################################################################
        /**
        * Links CSS to the page from a given relative path
@@ -343,7 +343,7 @@ JS;
        {
                $this->css .= "\n\t<link rel=\"stylesheet\" href=\"$path\" />";
        }
-       
+
        // ###################################################################
        /**
        * Imbeds actual CSS information into the page in <style> tags
@@ -359,7 +359,7 @@ JS;
                $css = trim($css);
                $this->css .= "\n\t<style type=\"text/css\">\n\t<!--\n" . $css . "\n\t//-->\n\t</style>";
        }
-       
+
        // ###################################################################
        /**
        * Places raw HTML code directly into the documet at the current
@@ -380,7 +380,7 @@ JS;
                        $this->code .= "\n\n$code\n\n";
                }
        }
-       
+
        // ###################################################################
        /**
        * A block function that produces a table with a message in it. This
@@ -399,7 +399,7 @@ JS;
                $this->row_span(($overridemessage ? $message : "<blockquote>$message</blockquote>"), ':swap:', 'left', 1);
                $this->table_end();
        }
-       
+
        // ###################################################################
        /**
        * Produces an entire page layout that asks the user whether or not
@@ -419,26 +419,26 @@ JS;
                {
                        define('ISSO_PRINTER_NO_NAVIGATION', 1);
                }
-               
+
                $this->page_start(T('Confirm'));
-               
+
                $this->form_start($location, $action);
                foreach ($params AS $key => $value)
                {
                        $this->form_hidden_field($key, $value);
                }
-               
+
                $this->table_start(true, '75%');
                $this->table_head(T('Confirm'), 1);
                $this->row_span("<blockquote>$message</blockquote>", ':swap:', 'left', 1);
                $this->row_submit('<input type="button" class="button" name="no" value="  ' . T('No') . '  " onclick="history.back(1); return false;" />', T('Yes'), '');
                $this->table_end();
-               
+
                $this->form_end();
-               
+
                $this->page_end();
        }
-       
+
        // ###################################################################
        /**
        * Closes the HTML document structure an adds the copyright; this also
@@ -452,7 +452,7 @@ JS;
                {
                        ob_clean();
                        ob_end_clean();
-                       
+
                        if (is_array($this->registry->modules[ISSO_DB_LAYER]->history))
                        {
                                foreach ($this->registry->modules[ISSO_DB_LAYER]->history AS $query)
@@ -462,27 +462,27 @@ JS;
                        }
                        exit;
                }
-               
+
                if ($this->registry->is_loaded('printer_navigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR (defined('ISSO_PRINTER_NO_NAVIGATION') AND constant('ISSO_PRINTER_NO_NAVIGATION') != true)))
                {
                        echo $this->registry->modules['printer_navigation']->generate_footer_html();
                }
-               
+
                $copyright = "\n<br />\n<p align=\"center\" class=\"copyright\">\n\t<a href=\"http://www.bluestatic.org\" target=\"_blank\">" . $this->registry->getApplication() . ' ' . $this->registry->getAppVersion() . ", &copy;2002 - " . date('Y') . " Blue Static</a>\n</p>";
-                               
+
                if (!defined('ISSO_PRINTER_HIDE_SETUP'))
                {
                        echo "\n$copyright";
                        echo $this->registry->construct_debug_block(false);
                }
-               
+
                echo "\n\n</body>\n</html>";
-               
+
                exit;
        }
-       
+
        // -------------------------------------------------------------------
-       
+
        // ###################################################################
        /**
        * Opens a <table> tag with styling
@@ -498,10 +498,10 @@ JS;
                {
                        echo '<br />';
                }
-               
+
                echo "\n<table cellpadding=\"4\" cellspacing=\"1\" border=\"0\" align=\"center\" width=\"$width\" class=\"tborder\">\n";
        }
-       
+
        // ###################################################################
        /**
        * Adds a table row that is sued to head the entire table
@@ -516,7 +516,7 @@ JS;
        {
                echo "<tr>\n\t<td class=\"tcat\" align=\"center\" colspan=\"$colspan\">"  . (($strong) ? "<strong>$title</strong>" : $title) . "</td>\n</tr>\n";
        }
-       
+
        // ###################################################################
        /**
        * Creates column headings; useful for a grid-style page. This uses a
@@ -532,18 +532,18 @@ JS;
                if (is_array($columnarray))
                {
                        $render = "<tr valign=\"top\" align=\"center\">\n";
-                       
+
                        foreach ($columnarray AS $header)
                        {
                                $render .= "\t<td class=\"thead\" align=\"center\">$header</td>\n";
                        }
-                       
+
                        $render .= "</tr>\n";
-                       
+
                        echo $render;
                }
        }
-       
+
        // ###################################################################
        /**
        * Closes a <table> tag
@@ -554,9 +554,9 @@ JS;
        {
                echo "\n</table>\n";
        }
-       
+
        // -------------------------------------------------------------------
-       
+
        // ###################################################################
        /**
        * Starts a <form> tag and adds the DO hidden input field
@@ -572,13 +572,13 @@ JS;
        function form_start($action, $do, $enctype = false, $name = 'inputform', $submitmethod = 'post')
        {
                echo "\n<!-- input form -->\n<form name=\"$name\" action=\"$action\"" . (($enctype) ? " enctype=\"$enctype\"" : '') . " method=\"$submitmethod\">\n";
-               
+
                if ($do !== null)
                {
                        $this->form_hidden_field('do', $do);
                }
        }
-       
+
        // ###################################################################
        /**
        * Adds a hidden field at the current location
@@ -592,7 +592,7 @@ JS;
        {
                echo "<input type=\"hidden\" name=\"$name\" value=\"$value\" />\n";
        }
-       
+
        // ###################################################################
        /**
        * Closes a <form> tag
@@ -603,9 +603,9 @@ JS;
        {
                echo "</form>\n<!-- / input form -->\n";
        }
-       
+
        // -------------------------------------------------------------------
-       
+
        // ###################################################################
        /**
        * Creates a table row that spans an entire row; this is used to divide
@@ -639,10 +639,10 @@ JS;
                                $is_style_element = false;
                        }
                }
-               
+
                echo "\n<tr>\n\t<td ". (($is_style_element) ? "style=\"$style\"" : "class=\"$row_class\"") . " colspan=\"$colspan\" align=\"$align\">$text</td>\n</tr>";
        }
-       
+
        // ###################################################################
        /**
        * Creates a table row that has more than two columns; this is used in
@@ -656,14 +656,14 @@ JS;
        function row_multi_item($row_array)
        {
                $this->registry->modules['functions']->exec_swap_bg();
-               
+
                foreach ($row_array AS $item => $align)
                {
                        $row_data["$align"][] = $item;
                }
-               
+
                echo "<tr valign=\"top\">";
-               
+
                foreach ($row_data AS $align_key => $item_array)
                {
                        if ($align_key == 'c')
@@ -678,16 +678,16 @@ JS;
                        {
                                $align = 'right';
                        }
-                       
+
                        foreach ($item_array AS $value)
                        {
                                echo "\n\t<td class=\"{$this->registry->modules['functions']->bgcolour}\" align=\"$align\">$value</td>";
                        }
                }
-               
+
                echo "\n</tr>\n";
        }
-       
+
        // ###################################################################
        /**
        * Generic row creation function that has two columns: label and value;
@@ -705,7 +705,7 @@ JS;
        function row_text($label, $value = '&nbsp;', $valign = 'top', $colspan = 2, $class = -1)
        {
                global $IS_SETTINGS;
-               
+
                if ($class == -1)
                {
                        if (!$IS_SETTINGS)
@@ -721,15 +721,15 @@ JS;
                else
                {
                        $row_class = $class;
-               }       
-               
+               }
+
                echo "<tr valign=\"$valign\">";
                echo "\n\t<td class=\"$row_class\">$label</td>";
                echo "\n\t<td class=\"$row_class\" colspan=\"" . ($colspan - 1) . "\">$value</td>";
-               
+
                echo "\n</tr>\n";
        }
-       
+
        // ###################################################################
        /**
        * Creates a table row with an <input> text field as the value column
@@ -749,7 +749,7 @@ JS;
        {
                $this->row_text($label, "<input type=\"" . (($password) ? 'password' : 'text') . "\" class=\"input\" name=\"$name\" value=\"$value\" size=\"$size\" " . (($length) ? "maxlength=\"$length\" " : '') . "/>", $lalign, $colspan);
        }
-       
+
        // ###################################################################
        /**
        * Creates a table row with a <textarea> as the value column
@@ -769,7 +769,7 @@ JS;
        {
                $this->row_text($label, "<textarea name=\"$name\" class=\"" . (($code) ? 'code' : 'input') . "\" rows=\"$rows\" cols=\"$cols\"" . (($style) ? ' style="' . $style . '"' : '') . ">$value</textarea>", 'top', $colspan);
        }
-       
+
        // ###################################################################
        /**
        * Creates a table row with the tfoot class
@@ -783,7 +783,7 @@ JS;
        {
                echo $this->row_span($data, 'tfoot', 'center', $colspan);
        }
-       
+
        // ###################################################################
        /**
        * Creates a tfoot table row with submit buttons
@@ -805,7 +805,7 @@ JS;
                {
                        $submit = "  $submit  ";
                }
-               
+
                if ($reset === ':reset:')
                {
                        $reset = "  " . T('Reset') . "  ";
@@ -814,14 +814,14 @@ JS;
                {
                        $reset = (($reset) ? "  $reset  " : '');
                }
-               
+
                $output = "\n\t\t<input type=\"submit\" class=\"button\" name=\"__submit__\" value=\"$submit\" accesskey=\"s\" />";
                $output .= ($reset ? "\n\t\t<input type=\"reset\" class=\"button\" name=\"__reset__\" value=\"$reset\" accesskey=\"r\" />" : '');
                $output .= ($extra ? "\n\t\t$extra" : '');
                $output .= "\n\t";
                $this->row_tfoot($output, $colspan);
        }
-       
+
        // ###################################################################
        /**
        * Creates an upload row; you need to specify some other paramaters in
@@ -837,7 +837,7 @@ JS;
        {
                $this->row_text($label, "<input type=\"file\" class=\"button\" name=\"$name\" size=\"35\" />", 'top', $colspan);
        }
-       
+
        // ###################################################################
        /**
        * Adds a name-value pair to an array that is constructed into a
@@ -852,10 +852,10 @@ JS;
        function list_item($name, $value, $selected = false)
        {
                global $listitem;
-               
+
                $listitem["$value"] = array('name' => $name, 'selected' => $selected);
        }
-       
+
        // ###################################################################
        /**
        * Assembles a <select> table row from list_item() items
@@ -870,17 +870,17 @@ JS;
        function row_list($label, $name, $is_jump = false, $colspan = 2)
        {
                global $listitem;
-               
+
                foreach ($listitem AS $value => $option)
                {
-                       $optionlist .= "\n\t<option value=\"$value\"" . ($option['selected'] == true ? ' selected="selected"' : '') . ">$option[name]</option>";        
+                       $optionlist .= "\n\t<option value=\"$value\"" . ($option['selected'] == true ? ' selected="selected"' : '') . ">$option[name]</option>";
                }
-               
+
                $listitem = array();
-               
+
                $this->row_text($label, "\n<select class=\"button\" name=\"$name\"" . (($is_jump) ? " onchange=\"this.form.submit();\"" : '') . ">$optionlist\n</select>" . (($is_jump) ? "\n<input type=\"submit\" class=\"button\" value=\"  " . T('Go') . "  \" accesskey=\"g\" />" : '') . "\n", $colspan);
        }
-       
+
        // ###################################################################
        /**
        * Assembles a list of checkboxes from list_item() items
@@ -894,17 +894,17 @@ JS;
        function row_checkbox($label, $name, $colspan = 2)
        {
                global $listitem;
-               
+
                foreach ($listitem AS $value => $box)
                {
                        $optionlist[] = "\n\t<input type=\"checkbox\" class=\"button\" name=\"{$name}[]\" value=\"$value\"" . ($box['selected'] == true ? ' checked="checked"' : '') . " /> $box[name]";
                }
-               
+
                $listitem = array();
-               
+
                $this->row_text($label, "\n" . implode('<br />', $optionlist) . "\n", $colspan);
        }
-       
+
        // ###################################################################
        /**
        * Creates a row with two radio buttons: yes and now
index be1c1c78b4c5bb1ebdd5297ee80b40525a74ad11..777dce0a9c942bd87613cc402821f5567b695d91 100644 (file)
@@ -40,7 +40,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Printer_CSS
 {
@@ -50,28 +50,28 @@ class Printer_CSS
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * CSS block list
        * @var  array
        * @access       private
        */
        var $descriptors = array();
-       
+
        /**
        * Master data set
        * @var  array
        * @access       private
        */
        var $masterdata = array();
-       
+
        /**
        * Cutomized data set
        * @var  array
        * @access       private
        */
        var $customdata = array();
-       
+
        /**
        * Valid properties that can be used in CSS
        * @var  array
@@ -85,14 +85,14 @@ class Printer_CSS
                'font-family'           => 'font_family',
                'text-decoration'       => 'text_decoration'
        );
-       
+
        /**
        * Hook ran in fetch_modified_link; takes three params: $descriptor, $property, $name
        * @var  string
        * @access       private
        */
        var $fetch_modified_link_hook = ':=NO METHOD=:';
-       
+
        /**
        * Module fields
        * @var  array
@@ -101,7 +101,7 @@ class Printer_CSS
        var $fields = array(
                'fetch_modified_link_hook'      => array(REQ_YES,       null,   false)
        );
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -110,7 +110,7 @@ class Printer_CSS
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -119,7 +119,7 @@ class Printer_CSS
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Sets an ISSO field
@@ -133,7 +133,7 @@ class Printer_CSS
        {
                $this->registry->do_set($name, $value, 'printer_css');
        }
-       
+
        // ###################################################################
        /**
        * Gets an ISSO field
@@ -148,7 +148,7 @@ class Printer_CSS
        {
                return $this->registry->do_get($fieldname, 'printer_css');
        }
-       
+
        // ###################################################################
        /**
        * Adds a CSS information block to the array for later use
@@ -166,14 +166,14 @@ class Printer_CSS
                        trigger_error('The descriptor `' . $descriptor . '` already exists', E_USER_WARNING);
                        return;
                }
-               
+
                $this->descriptors["$descriptor"] = array(
                        'title'                 => $title,
                        'descriptor'    => $descriptor,
                        'dolink'                => $dolink
                );
        }
-       
+
        // ###################################################################
        /**
        * Sets a master data key for a given descriptor and property
@@ -188,7 +188,7 @@ class Printer_CSS
        {
                $this->masterdata["$descriptor"]["$property"] = $value;
        }
-       
+
        // ###################################################################
        /**
        * Sets a custom data key for a given descriptor and property
@@ -203,7 +203,7 @@ class Printer_CSS
        {
                $this->customdata["$descriptor"]["$property"] = $value;
        }
-       
+
        // ###################################################################
        /**
        * Generates the HTML needed to output the CSS editing blocks; this is
@@ -214,43 +214,43 @@ class Printer_CSS
        function generate_blocks()
        {
                $print =& $this->registry->modules['printer'];
-               
+
                $lang = array(
                        'standard_css_attributes'       => T('Standard CSS Attributes'),
                        'extra_css_attributes'          => T('Extra CSS Attributes'),
-                       
+
                        'links_normal'                          => T('Normal CSS Links'),
                        'links_visited'                         => T('Visited CSS Links'),
                        'links_hover'                           => T('Hover CSS Links'),
-                       
+
                        'background'                            => T('Background'),
                        'font_color'                            => T('Font Color'),
                        'font_style'                            => T('Font Style'),
                        'font_size'                                     => T('Font Size'),
                        'font_family'                           => T('Font Family'),
-                       
+
                        'text_decoration'                       => T('Text Decoration'),
-                       
+
                        'css_selector'                          => T('CSS Selector'),
                        'save_css'                                      => T('Save CSS')
                );
-               
+
                foreach ($this->descriptors AS $descriptor)
                {
                        $value = array();
                        $status = array();
-                       
+
                        $desc = $descriptor['descriptor'];
-                       
+
                        $print->table_start();
                        $print->table_head($descriptor['title']);
-                       
+
                        foreach ($this->properties AS $prop => $name)
                        {
                                $value["$name"] = $this->fetch_value($descriptor['descriptor'], $prop);
                                $status["$name"] = $this->fetch_modified_status($descriptor['descriptor'], $prop);
                        }
-                       
+
                        $value['extra'] = $this->fetch_value($descriptor['descriptor'], 'extra');
 
                        $html = "<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" width=\"100%\">
@@ -258,7 +258,7 @@ class Printer_CSS
        <td width=\"50%\">
                <fieldset>
                        <legend><strong>$lang[standard_css_attributes]</strong></legend>
-                       
+
                        <table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"100%\">
                                <tr>
                                        <td width=\"45%\">" . $this->fetch_modified_link($desc, 'background', $lang['background']) . "</td>
@@ -283,7 +283,7 @@ class Printer_CSS
                        </table>
                </fieldset>
        </td>
-       
+
        <td>
                <fieldset style=\"height: 115px\">
                        <legend><strong>" . $this->fetch_modified_link($desc, 'extra', $lang['extra_css_attributes']) . "</strong></legend>
@@ -302,7 +302,7 @@ class Printer_CSS
                                                $status["{$selname}_{$name}"] = $this->fetch_modified_status($descriptor['descriptor'] . ' ' . $sel, $prop);
                                        }
                                }
-                               
+
                                $html .= "
 
 <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" width=\"100%\">
@@ -310,7 +310,7 @@ class Printer_CSS
        <td width=\"33%\">
                <fieldset>
                        <legend><strong>$lang[links_normal]</strong></legend>
-                       
+
                        <table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"100%\">
                                <tr>
                                        <td width=\"45%\">" . $this->fetch_modified_link($desc . ' a:link', 'background', $lang['background']) . "</td>
@@ -327,11 +327,11 @@ class Printer_CSS
                        </table>
                </fieldset>
        </td>
-       
+
        <td width=\"33%\">
                <fieldset>
                        <legend><strong>$lang[links_visited]</strong></legend>
-                       
+
                        <table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"100%\">
                                <tr>
                                        <td width=\"45%\">" . $this->fetch_modified_link($desc . ' a:visited', 'background', $lang['background']) . "</td>
@@ -348,11 +348,11 @@ class Printer_CSS
                        </table>
                </fieldset>
        </td>
-       
+
        <td width=\"33%\">
                <fieldset>
                        <legend><strong>$lang[links_hover]</strong></legend>
-                       
+
                        <table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"100%\">
                                <tr>
                                        <td width=\"45%\">" . $this->fetch_modified_link($desc . ' a:hover', 'background', $lang['background']) . "</td>
@@ -372,17 +372,17 @@ class Printer_CSS
 </tr>
 </table>";
                        }
-                       
+
                        $print->row_span($html, 'alt2', 'left', 1);
-                       
+
                        $print->row_span('
                                                        <div class="alt1" style="border: inset 1px; padding: 2px 5px 2px 5px; float: left">' . $lang['css_selector'] . ': <code>' . $descriptor['descriptor'] . '</code></div>
                                                        <input type="submit" name="submit" value="' . $lang['save_css'] . '" class="button" />', 'tfoot', 'right', 1);
-                       
+
                        $print->table_end();
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns the value of a given descriptor and property by comparing
@@ -406,7 +406,7 @@ class Printer_CSS
                        return $this->customdata["$descriptor"]["$property"];
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns the state modified state (false for untouched and true
@@ -426,10 +426,10 @@ class Printer_CSS
                {
                        return true;
                }
-               
+
                return false;
        }
-       
+
        // ###################################################################
        /**
        * Fetches a link that shows a revert link for a given property
@@ -446,7 +446,7 @@ class Printer_CSS
        function fetch_modified_link($descriptor, $property, $name)
        {
                $status = $this->fetch_modified_status($descriptor, $property);
-               
+
                if ($status)
                {
                        if (is_callable($this->fetch_modified_link_hook))
@@ -463,11 +463,11 @@ class Printer_CSS
                        return $name;
                }
        }
-       
+
        // ###################################################################
        /**
        * Generates an array of queries that should be run on your database to
-       * update CSS changes. All of the queries have sprintf() markers that 
+       * update CSS changes. All of the queries have sprintf() markers that
        * need to be evaluated:
        *
        * %1$s - Database table
@@ -486,13 +486,13 @@ class Printer_CSS
        function generate_change_query($data)
        {
                $queries[0] = '--- RESERVED FOR LATER USE ---';
-               
+
                $deletes = array();
-               
+
                foreach ($this->descriptors AS $descriptor => $opts)
                {
                        $dolink = $opts['dolink'];
-                       
+
                        if ($dolink)
                        {
                                $loops = array('', ' a:link', ' a:visited', ' a:hover');
@@ -501,7 +501,7 @@ class Printer_CSS
                        {
                                $loops = array('');
                        }
-                       
+
                        foreach ($loops AS $sel)
                        {
                                foreach ($data["$descriptor$sel"] AS $prop => $value)
@@ -526,7 +526,7 @@ class Printer_CSS
                                }
                        }
                }
-               
+
                if (sizeof($deletes) < 1)
                {
                        $queries[0] = '##';
@@ -535,10 +535,10 @@ class Printer_CSS
                {
                        $queries[0] = "DELETE FROM %1\$s WHERE styleid = %6\$d AND ((" . implode(') OR (', $deletes) . "))";
                }
-               
+
                return $queries;
        }
-       
+
        // ###################################################################
        /**
        * Wrapper for $this->registry->modules[ISSO_DB_LAYER]->escape_string()
@@ -553,7 +553,7 @@ class Printer_CSS
        {
                return $this->registry->modules[ISSO_DB_LAYER]->escape_string($string);
        }
-       
+
        // ###################################################################
        /**
        * Generates a linkable/usable CSS stylehseet content file; this can
@@ -566,11 +566,11 @@ class Printer_CSS
        function generate_css_output()
        {
                $data = array();
-               
+
                foreach ($this->descriptors AS $descriptor => $opts)
                {
                        $dolink = $opts['dolink'];
-                       
+
                        if ($dolink)
                        {
                                $loops = array('', ' a:link', ' a:visited', ' a:hover');
@@ -579,7 +579,7 @@ class Printer_CSS
                        {
                                $loops = array('');
                        }
-                       
+
                        foreach ($loops AS $sel)
                        {
                                foreach ($this->masterdata["$descriptor$sel"] AS $prop => $value)
@@ -595,9 +595,9 @@ class Printer_CSS
                                }
                        }
                }
-               
+
                $output = '/* CSS Style Sheet (generated by ISSO.Printer.CSS $Revision$) */';
-               
+
                foreach ($data AS $selector => $props)
                {
                        $output .= "\n\n$selector\n{";
@@ -608,20 +608,20 @@ class Printer_CSS
                                        $output .= str_replace('&quot;', '"', "\n\t$name: $value;");
                                }
                        }
-                       
+
                        if ($props['extra'])
                        {
                                $extra = explode("\n", $this->registry->modules['functions']->convert_line_breaks($props['extra']));
-                               
+
                                foreach ($extra AS $prop)
                                {
                                        $output .= "\n\t$prop";
                                }
                        }
-                       
+
                        $output .= "\n}";
                }
-               
+
                return $output;
        }
 }
index b0e018a2c6cebd0da3fba2a7260fd19368b319f9..ce60c8071deb5d14b76e205c7295afe70fec075f 100644 (file)
@@ -38,7 +38,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Printer_Navigation
 {
@@ -48,42 +48,42 @@ class Printer_Navigation
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * Global links that are used for admin home, logout, etc.
        * @var  array
        * @access       private
        */
        var $toplinks = array();
-       
+
        /**
        * Navigational tabs: array(text, url)
        * @var  array
        * @access       private
        */
        var $tabs = array();
-       
+
        /**
        * Sections: text
        * @var  array
        * @access       private
        */
        var $sections = array();
-       
+
        /**
        * Links: array(text, url)
        * @var  array
        * @access       private
        */
        var $links = array();
-       
+
        /**
        * Array of scopes to set focus to key
        * @var  array
        * @access       private
        */
        var $focus = array('tab' => null, 'link' => null);
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -92,7 +92,7 @@ class Printer_Navigation
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -101,7 +101,7 @@ class Printer_Navigation
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Adds a global link to the array; these cannot be removed once added
@@ -115,10 +115,10 @@ class Printer_Navigation
        {
                $this->toplinks["$href"] = $text;
        }
-       
+
        // ###################################################################
        /**
-       * Adds to the structure array. The following is the global structure 
+       * Adds to the structure array. The following is the global structure
        * of the array, but you can specify any entry point. When you add onto
        * the structure, it will go at the bottom
        * array(
@@ -154,7 +154,7 @@ class Printer_Navigation
                        $this->links["$parent"]["$key"] = array($text, $url);
                }
        }
-       
+
        // ###################################################################
        /**
        * Sets the focus for either a tab or link
@@ -194,7 +194,7 @@ class Printer_Navigation
                        trigger_error('Printer_Navigation::set_focus() only allows setting of focus for tab and link scopes', E_USER_ERROR);
                }
        }
-       
+
        // ###################################################################
        /**
        * Generates the header HTML that is called in ISSO.Printer->page_start()
@@ -207,28 +207,28 @@ class Printer_Navigation
        function generate_header_html()
        {
                $output = '<!-- navigation start -->' . "\n\n";
-               
+
                // -------------------------------------------------------------------
-               
+
                $output2 = array();
                foreach ($this->toplinks AS $href => $text)
                {
                        $output2[] = '<a href="' . $href . '">' . $text . '</a>';
                }
-               
+
                $language = $this->registry->modules['printer']->getLanguageInformation();
-               
+
                $output .= "\n" . '<div id="toplinks" style="float: ' . ($language['direction'] == 'rtl' ? 'left' : 'right') . '">';
                $output .= "\n\t" . '<div>' . $this->registry->getApplication() . ' ' . $this->registry->modules['printer']->getRealm() . '</div>';
                $output .= "\n\t" . '<div id="toplinks-links">' . implode(' &bull; ', $output2) . '</div>';
                $output .= "\n" . '</div>';
-               
+
                // -------------------------------------------------------------------
-               
+
                $output .= "\n\n" . '<div id="wrapper">';
-               
+
                // -------------------------------------------------------------------
-               
+
                $output .= "\n" . '<div id="tabbar">';
                foreach ($this->tabs AS $key => $content)
                {
@@ -237,20 +237,20 @@ class Printer_Navigation
                        {
                                $link .= ' id="focustab"';
                        }
-                       
+
                        $link .= '><span>' . $content[0] . '</span></a>';
-                       
+
                        $output .= $link;
                }
                $output .= "\n" . '</div>';
-               
+
                // -------------------------------------------------------------------
-               
+
                $output .= "\n\n" . '<table id="contentbody" cellspacing="0" cellpadding="0" border="0">';
                $output .= "\n" . '<tr>';
-               
+
                // -------------------------------------------------------------------
-               
+
                $output .= "\n" . '<td id="menu">';
                foreach ((array)$this->sections[ $this->focus['tab'] ] AS $key => $text)
                {
@@ -263,15 +263,15 @@ class Printer_Navigation
                        $output .= "\n" . '</ul>' . "\n";
                }
                $output .= "\n" . '</td>';
-               
+
                // -------------------------------------------------------------------
-               
+
                $output .= "\n" . '<td id="mainbody">';
                $output .= "\n\n" . '<!-- main content body -->' . "\n";
-               
+
                return $output;
        }
-       
+
        // ###################################################################
        /**
        * Generates the HTML that is inserted in ISSO.Printer->page_end() that
@@ -284,16 +284,16 @@ class Printer_Navigation
        function generate_footer_html()
        {
                $output = '';
-               
+
                $output .= "\n" . '<!-- / main content body -->' . "\n";
-               
+
                $output .= "\n" . '</td>';
                $output .= "\n" . '</tr>';
-               
+
                $output .= "\n\n" . '</table>';
-               
+
                $output .= "\n\n" . '</div>';
-               
+
                return $output;
        }
 }
index 4c6fbad645080dc60a04e013d1168db117aa29dd..90f6103235b7effc1d4bd861a0ed0dda55d32ce1 100644 (file)
@@ -40,7 +40,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Template
 {
@@ -50,84 +50,84 @@ class Template
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * Name of the database table templates are in
        * @var  string
        * @access       private
        */
        var $tablename = '';
-       
+
        /**
        * Name of the table column template names are in
        * @var  string
        * @access       private
        */
        var $namecolumn = '';
-       
+
        /**
        * Name of the table column templates are in
        * @var  string
        * @access       private
        */
        var $datacolumn = '';
-       
+
        /**
        * Additional WHERE clauses for the template fetch SQL
        * @var  string
        * @access       private
        */
        var $extrawhere = '';
-       
+
        /**
        * The name of the function phrases are fetched with
        * @var  string
        * @access       private
        */
        var $langcall = 'gettext';
-       
+
        /**
        * The name of the function phrases are sprintf() parsed with
        * @var  string
        * @access       private
        */
        var $langconst = 'sprintf';
-       
+
        /**
        * Array of pre-compiled templates that are stored to decrease server load
        * @var  array
        * @access       private
        */
        var $cache = array();
-       
+
        /**
        * A list of the number of times each template has been used
        * @var  array
        * @access       private
        */
        var $usage = array();
-       
+
        /**
        * A list of templates that weren't cached, but are still used
        * @var  array
        * @access       private
        */
        var $uncached = array();
-       
+
        /**
        * Whether or not the page has been flush()'d already
        * @var  bool
        * @access       private
        */
        var $doneflush = false;
-       
+
        /**
        * The name of a function that is called before template parsing of phrases and conditionals occurs
        * @var  string
        * @access       private
        */
        var $pre_parse_hook = ':=NO METHOD=:';
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -136,7 +136,7 @@ class Template
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -145,7 +145,7 @@ class Template
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Initializes the class and all subclasses under a common package name
@@ -158,7 +158,7 @@ class Template
        {
                return 'template';
        }
-       
+
        // ###################################################################
        /**
        * Sets tablename
@@ -171,7 +171,7 @@ class Template
        {
                $this->tablename = $name;
        }
-       
+
        // ###################################################################
        /**
        * Sets namecolumn
@@ -184,7 +184,7 @@ class Template
        {
                $this->namecolumn = $name;
        }
-       
+
        // ###################################################################
        /**
        * Sets datacolumn
@@ -197,7 +197,7 @@ class Template
        {
                $this->datacolumn = $name;
        }
-       
+
        // ###################################################################
        /**
        * Sets extrawhere
@@ -210,7 +210,7 @@ class Template
        {
                $this->extrawhere = $sql;
        }
-       
+
        // ###################################################################
        /**
        * Sets the pre-parse hook
@@ -223,7 +223,7 @@ class Template
        {
                $this->pre_parse_hook = $name;
        }
-       
+
        // ###################################################################
        /**
        * Takes an array of template names, loads them, and then stores a
@@ -249,7 +249,7 @@ class Template
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Loads a template from the cache or the _load function and stores the
@@ -274,17 +274,17 @@ class Template
                        $template = $this->_load($name);
                        $template = $this->_parse($template);
                }
-               
+
                if (!isset($this->usage["$name"]))
                {
                        $this->usage["$name"] = 0;
                }
-               
+
                $this->usage["$name"]++;
-               
+
                return $template;
        }
-       
+
        // ###################################################################
        /**
        * Output a template fully compiled to the browser
@@ -296,13 +296,13 @@ class Template
        function flush($template)
        {
                ob_start();
-               
+
                if (empty($template))
                {
                        trigger_error('There was no output to print', E_USER_ERROR);
                        exit;
                }
-               
+
                if ($this->registry->debug AND isset($_GET['query']))
                {
                        if (is_array($this->registry->modules[ISSO_DB_LAYER]->history))
@@ -314,18 +314,18 @@ class Template
                        }
                        exit;
                }
-               
+
                if ($this->doneflush)
                {
                        trigger_error('A template has already been sent to the output buffer', E_USER_ERROR);
                        exit;
                }
-               
+
                $template = str_replace('</body>', $this->registry->construct_debug_block(true) . '</body>', $template);
 
                print($template);
        }
-       
+
        // ###################################################################
        /**
        * Loads an additional template from the database
@@ -348,7 +348,7 @@ class Template
                        exit;
                }
        }
-       
+
        // ###################################################################
        /**
        * A wrapper for all the parsing functions and compiling functins
@@ -362,17 +362,17 @@ class Template
        function _parse($template)
        {
                $template = str_replace('"', '\"', $template);
-               
+
                if (function_exists($this->pre_parse_hook))
                {
                        $template = call_user_func($this->pre_parse_hook, $template);
                }
-               
+
                $template = $this->_parse_phrases($template);
                $template = $this->_parse_conditionals($template);
                return $template;
        }
-       
+
        // ###################################################################
        /**
        * Prepares language and locale information inside templates
@@ -388,10 +388,10 @@ class Template
                $tag_start = '<lang ';
                $tag_start_end = '\">';
                $tag_end = '</lang>';
-               
+
                $location_start = -1;
                $location_end = -1;
-               
+
                while (1)
                {
                        // Find the start language object tag
@@ -400,29 +400,29 @@ class Template
                        {
                                break;
                        }
-               
+
                        // Find the end tag
                        $location_end = strpos($template, $tag_end, $location_end + strlen($tag_end));
                        if ($location_end === false)
                        {
                                break;
                        }
-                       
+
                        // Extract the language object
                        $phrase_bunch = substr($template, $location_start, ($location_end + strlen($tag_end)) - $location_start);
-                       
+
                        // Find the close to the opening <lang>
                        $close_of_open = strpos($phrase_bunch, $tag_start_end);
                        if ($close_of_open === false)
                        {
                                break;
                        }
-                       
+
                        // Extract the opening tag so it can be parsed
                        $init_tag = substr($phrase_bunch, 0, ($close_of_open + strlen($tag_start_end)));
                        $init_tag = str_replace($tag_start, '', $init_tag);
                        $init_tag = substr($init_tag, 0, strlen($init_tag) - 1);
-                       
+
                        // Get the args out of the tag
                        $args = preg_split('#([0-9].*?)=#', $init_tag);
                        foreach ($args AS $arg)
@@ -435,25 +435,25 @@ class Template
                                        $arglist[] = $arg;
                                }
                        }
-                       
+
                        // Just get the phrase name
                        $phrase_name = preg_replace('#<lang(.*?)>(.*?)</lang>#i', '$2', $phrase_bunch);
-                       
+
                        // Wrap the parsed data into the build function
                        $function_wrap = '" . ' . $this->langconst . '("' . /*str_replace(array('\"', "'"), array('"', "\'"),*/ $phrase_name/*)*/ . '", "' . implode('", "', $arglist) . '") . "';
-                       
+
                        // Replace the fully-parsed string back into the template
                        $template = substr_replace($template, $function_wrap, $location_start, $location_end + strlen($tag_end) - $location_start);
-                       
+
                        unset($arglist);
                }
-               
+
                // Process the empty phrase objects -- do this now so we don't have to worry about it when we're parsing later
                $template = preg_replace('#\{@\\\"(.*?)\\\"\}#ise', '$this->_phrase_string(\'$1\')', $template);
-               
+
                return $template;
        }
-       
+
        // ###################################################################
        /**
        * Turns a localized phrase tag into a function call
@@ -468,7 +468,7 @@ class Template
        {
                return '" . ' . $this->langcall . '(\'' . str_replace(array('\\\"', "'"), array('"', "\'"), $text) . '\') . "';
        }
-       
+
        // ###################################################################
        /**
        * Parser for in-line template conditionals
@@ -486,24 +486,24 @@ class Template
                $tag_start_end = '\">';
                $tag_else = '<else />';
                $tag_end = '</if>';
-               
+
                // tag stack
                $stack = array();
-               
+
                // the information about the current active tag
                $tag_full = array();
                $parsed = array();
-               
+
                // start at 0
                $offset = 0;
-               
+
                while (1)
                {
                        if (strpos($template, $tag_start) === false)
                        {
                                break;
                        }
-                       
+
                        for ($i = $offset; $i < strlen($template); $i++)
                        {
                                // we've found ourselves a conditional!
@@ -535,40 +535,40 @@ class Template
                                                array_pop($stack);
                                                continue;
                                        }
-                                       
+
                                        // calculate the position of the end tag
                                        $tag_full['posf'] = $i + strlen($tag_end) - 1;
-                                       
+
                                        // extract the entire conditional from the template
                                        $fullspread = substr($template, $tag_full['posi'], $tag_full['posf'] - $tag_full['posi'] + 1);
-                                       
+
                                        // remove the beginning tag
                                        $conditional = substr($fullspread, strlen($tag_start));
-                                       
+
                                        // find the end of the expression
                                        $temp_end = strpos($conditional, $tag_start_end);
-                                       
+
                                        // save the expression
                                        $parsed[0] = stripslashes(substr($conditional, 0, $temp_end));
-                                       
+
                                        // remove the expression from the conditional
                                        $conditional = substr($conditional, strlen($parsed[0]) + strlen($tag_start_end));
-                                       
+
                                        // remove the tailing end tag
                                        $conditional = substr($conditional, 0, strlen($conditional) - strlen($tag_end));
-                                       
+
                                        // handle the else
                                        if (isset($tag_full['else']))
                                        {
                                                // now relative to the start of the <if>
                                                $relpos = $tag_full['else'] - $tag_full['posi'];
-                                               
+
                                                // calculate the length of the expression and opening tag
                                                $length = strlen($parsed[0]) + strlen($tag_start) + strlen($tag_start_end);
-                                               
+
                                                // relative to the start of iftrue
                                                $elsepos = $relpos - $length;
-       
+
                                                $parsed[1] = substr($conditional, 0, $elsepos);
                                                $parsed[2] = substr($conditional, $elsepos + strlen($tag_else));
                                        }
@@ -579,13 +579,13 @@ class Template
                                                $parsed[2] = '';
                                        }
                                        #var_dump($parsed);
-                                       
+
                                        // final parsed output
                                        $parsed = '" . ((' . stripslashes($parsed[0]) . ') ? "' . $parsed[1] . '" : "' . $parsed[2] . '") . "';
-                                       
+
                                        // replace the conditional
                                        $template = str_replace($fullspread, $parsed, $template);
-                                       
+
                                        // reset the parser
                                        $offset = $tag_full['posi'] + strlen($tag_start) + strlen($tag_start_end);
                                        $tag_full = array();
index 99238932fabdbff209e8a1bce41bf8c8a10936a4..946feab7168e33c79bb0f6affc264de7a911f6b5 100644 (file)
@@ -43,7 +43,7 @@ $this->load('template', null);
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class Template_FS extends Template
 {
@@ -53,21 +53,21 @@ class Template_FS extends Template
        * @access       private
        */
        var $templatedir = '';
-       
+
        /**
        * The extension all the template files have
        * @var  string
        * @access       private
        */
        var $extension = 'tpl';
-       
+
        /**
        * The database table name for the template cache
        * @var string
        * @access       private
        */
        var $dbCacheTable = null;
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -76,7 +76,7 @@ class Template_FS extends Template
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -85,7 +85,7 @@ class Template_FS extends Template
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Sets the template directory
@@ -98,7 +98,7 @@ class Template_FS extends Template
        {
                $this->templatedir = $this->registry->fetch_sourcepath($path);
        }
-       
+
        // ###################################################################
        /**
        * Sets the file extension
@@ -111,7 +111,7 @@ class Template_FS extends Template
        {
                $this->extension = $ext;
        }
-       
+
        // ###################################################################
        /**
        * Sets the name of the table to access for the datbase cache
@@ -122,7 +122,7 @@ class Template_FS extends Template
        {
                $this->dbCacheTable = $table;
        }
-       
+
        // ###################################################################
        /**
        * Takes an array of template names, loads them, and then stores a
@@ -177,7 +177,7 @@ class Template_FS extends Template
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Loads a template from the file system from the specified
index f088b5eb7c9ae85600b9b6670df986298cad7a30..8141a7736ead44b402788ac689b7ae51fa4b34c7 100644 (file)
@@ -35,7 +35,7 @@
 * @copyright   Copyright (c)2002 - [#]year[#], Blue Static
 * @version             $Revision$
 * @package             ISSO
-* 
+*
 */
 class XML
 {
@@ -45,49 +45,49 @@ class XML
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * Parser resource
        * @var  integer
        * @access       private
        */
        var $parser = null;
-       
+
        /**
        * An array of function names that are to be executed for each tag name (name => function)
        * @var  array()
        * @access       private
        */
        var $taghandler = array();
-       
+
        /**
        * Current CDATA value
        * @var  string
        * @access       private
        */
        var $cdata = '';
-       
+
        /**
        * Tag stack of all open nodes
        * @var  array
        * @access       private
        */
        var $stack = array();
-       
+
        /**
        * Node list for all open tag attributes
        * @var  array
        * @access       private
        */
        var $attribs = array();
-       
+
        /**
        * Resulting parsed array
        * @var  array
        * @access       private
        */
        var $result = array();
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -96,7 +96,7 @@ class XML
        {
                $this->registry =& $registry;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -105,7 +105,7 @@ class XML
        {
                $this->__construct($registry);
        }
-       
+
        // ###################################################################
        /**
        * Parse an XML file
@@ -123,7 +123,7 @@ class XML
                $this->attribs = array();
                $this->result = array();
                $this->cdata = '';
-               
+
                if ($utf8)
                {
                        $this->parser = xml_parser_create('UTF-8');
@@ -132,15 +132,15 @@ class XML
                {
                        $this->parser = xml_parser_create('ISO-8859-1');
                }
-               
+
                // create a new parser
                xml_set_object($this->parser, $this);
                xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
                xml_set_element_handler($this->parser, 'handle_tag_start', 'handle_tag_end');
                xml_set_character_data_handler($this->parser, 'handle_cdata');
-               
+
                $this->attach_node($this->result);
-               
+
                // parse the data and check for errors
                if (!xml_parse($this->parser, $data))
                {
@@ -151,14 +151,14 @@ class XML
                        trigger_error("XML Error: $error[string] at line $error[line] colunn $error[column]", E_USER_ERROR);
                        exit;
                }
-               
+
                // destroy the parser
                xml_parser_free($this->parser);
-               
+
                // done... send the results back
                return $this->result;
        }
-       
+
        // ###################################################################
        /**
        * Process the opening location of an XML tag
@@ -173,7 +173,7 @@ class XML
        {
                // we need to keep track of indicies to monitor the last key in $this->attribs
                static $index;
-               
+
                // trim attributes
                array_walk($attrs, 'trim');
 
@@ -187,7 +187,7 @@ class XML
                                unset($this->attribs["$name"]);
                                $this->attribs["$name"][0] = $tmp;
                        }
-                       
+
                        // create a new child node
                        $this->attribs["$name"][ $index["$name"] ] = (array)$attrs;
                        $this->attach_node($this->attribs["$name"][ $index["$name"] ]);
@@ -201,7 +201,7 @@ class XML
                        $index["$name"] = 1;
                }
        }
-       
+
        // ###################################################################
        /**
        * Process XML CDATA
@@ -215,7 +215,7 @@ class XML
        {
                $this->cdata .= $data;
        }
-       
+
        // ###################################################################
        /**
        * Process the closing of an XML tag
@@ -232,13 +232,13 @@ class XML
                {
                        $this->attribs['value'] = $this->cdata;
                }
-               
+
                $this->cdata = '';
-               
+
                // remove the node
                $this->detach_node();
        }
-       
+
        // ###################################################################
        /**
        * Shifts the node tree
@@ -251,11 +251,11 @@ class XML
        {
                // create a new node
                $this->stack[ sizeof($this->stack) ] =& $node;
-               
+
                // new attributes to work with
                $this->attribs =& $node;
        }
-       
+
        // ###################################################################
        /**
        * Unshifts the node tree
@@ -266,11 +266,11 @@ class XML
        {
                // drop the newest node
                unset($this->stack[ sizeof($this->stack) - 1 ]);
-               
+
                // assign the attributes to the next newest node
                $this->attribs =& $this->stack[ sizeof($this->stack) - 1 ];
        }
-       
+
        // ###################################################################
        /**
        * Unless a node has multiple children, there will not be a numerical
index da0dbffa8033f3f5bd621e4848298c2e166f8da1..5541663940f2dde9b5436927962f368556198676 100644 (file)
@@ -63,13 +63,13 @@ if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true))
                'username_display',
                'help_link'
        );
-       
+
        $start = microtime();
-       
+
        $template->cache(array_merge($globaltemplates, (array)$fetchtemplates));
-       
+
        $bugsys->debug('time for tpl cache: ' . $funct->fetch_microtime_diff($start));
-       
+
        eval('$header = "' . $template->fetch('header') . '";');
        eval('$doctype = "' . $template->fetch('doctype') . '";');
        eval('$headinclude = "' . $template->fetch('headinclude') . '";');
index 52f76f13ce8e14ee296616ffaedafa071c527690..51774def6f88fc3fad4a6a2c8b9392e5eefb9ad8 100644 (file)
@@ -28,7 +28,7 @@ $GLOBALS['isso:callback']->load('api', null);
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class AttachmentAPI extends API
 {
@@ -49,21 +49,21 @@ class AttachmentAPI extends API
                'userid'                => array(TYPE_UINT,     REQ_YES,        null,                           array('includes/api_user.php', 'UserAPI')),
                'obsolete'              => array(TYPE_BOOL,     REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'attachment';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Set field: dateline
index 651da4846ab6e2fcc14c5388219b925d275df4c8..7b7850fec43c5772d3171051838726ab07cfe505 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class AutomationAPI extends API
 {
@@ -46,21 +46,21 @@ class AutomationAPI extends API
                'fieldchanges'  => array(TYPE_NONE,             REQ_YES,        ':self'),
                'comment'               => array(TYPE_STR,              REQ_NO)
        );
-       
+
        /**
        * Table
        * @var  string
        * @access       private
        */
        var $table = 'automation';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -71,7 +71,7 @@ class AutomationAPI extends API
        {
                build_automations();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -82,7 +82,7 @@ class AutomationAPI extends API
        {
                build_automations();
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
@@ -93,7 +93,7 @@ class AutomationAPI extends API
        {
                build_automations();
        }
-       
+
        // ###################################################################
        /**
        * Verify: fieldchanges
@@ -106,14 +106,14 @@ class AutomationAPI extends API
                {
                        return T('Invalid array type passed. The fieldchaneges array must be a two-dimensional array: array("builtin" => array("fieldname" => "newvalue" ...), "custom" => array("fieldname" => "fieldvalue" ...))');
                }
-               
+
                if (sizeof($this->values['fieldchanges']['custom']) < 1 AND sizeof($this->values['fieldchanges']['builtin']) < 1)
                {
                        return T('You need to specify some fields to change.');
                }
-               
+
                $this->values['fieldchanges'] = serialize($this->values['fieldchanges']);
-               
+
                return true;
        }
 }
index 0757fb3597ee90ea908fcc2df88b1b3e134cbcb6..4d8f9058aedf844446b4deef8cac525f483d2854 100644 (file)
@@ -31,7 +31,7 @@ $GLOBALS['isso:callback']->load('api', null);
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class BugAPI extends API
 {
@@ -65,21 +65,21 @@ class BugAPI extends API
                'hiddenlastpostby'              => array(TYPE_UINT,     REQ_NO),
                'hiddenlastpostbyname'  => array(TYPE_STR,      REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'bug';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Subclassed set() that will intercept any custom fields and handle
@@ -92,11 +92,11 @@ class BugAPI extends API
                {
                        $this->fields["$field"] = array(TYPE_STR, REQ_NO);
                }
-               
+
                // TODO - (r1524) one day we can change this back to call_user_func_array(array($this, 'parent::set'), func_get_args())
                parent::set($field, $value, $doclean, $doverify);
        }
-       
+
        // ###################################################################
        /**
        * Set field: dateline
@@ -107,7 +107,7 @@ class BugAPI extends API
        {
                $this->set('dateline', time());
        }
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -118,7 +118,7 @@ class BugAPI extends API
        {
                $this->registry->db->query("INSERT INTO " . TABLE_PREFIX . "vote (bugid, votefor, voteagainst) VALUES (" . $this->insertid . ", 0, 0)");
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
@@ -132,7 +132,7 @@ class BugAPI extends API
                $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "history WHERE bugid = " . $this->values['bugid']);
                $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "vote WHERE bugid = " . $this->values['bugid']);
        }
-       
+
        // ###################################################################
        /**
        * Verify: product
@@ -145,14 +145,14 @@ class BugAPI extends API
                {
                        return $nozero;
                }
-               
+
                if (!$this->registry->datastore['product'][ $this->values['product'] ])
                {
                        return false;
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: componentid
@@ -177,7 +177,7 @@ class BugAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: versionid
@@ -190,14 +190,14 @@ class BugAPI extends API
                {
                        return $nozero;
                }
-               
+
                if (!$this->registry->datastore['version'][ $this->values['version'] ])
                {
                        return false;
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: priority
@@ -212,7 +212,7 @@ class BugAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: severity
@@ -227,7 +227,7 @@ class BugAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: status
@@ -242,7 +242,7 @@ class BugAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: resolution
@@ -257,7 +257,7 @@ class BugAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: assignedto
index 9e9a05ed632efb1c408ed9cf55489a5138b858b6..09f32693b513fdd60acc5e96bd2fdf93433ba2dc 100644 (file)
@@ -28,7 +28,7 @@ $GLOBALS['isso:callback']->load('api', null);
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class CommentAPI extends API
 {
@@ -47,21 +47,21 @@ class CommentAPI extends API
                'comment_parsed'        => array(TYPE_NONE,     REQ_SET),
                'hidden'                        => array(TYPE_BOOL,     REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'comment';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Set field: dateline
@@ -72,7 +72,7 @@ class CommentAPI extends API
        {
                $this->set('dateline', time());
        }
-       
+
        // ###################################################################
        /**
        * Set field: comment_parsed
@@ -88,7 +88,7 @@ class CommentAPI extends API
                        $comment = preg_replace('#bug://((report|problem)/)?([0-9]*)#i', '<a href="showreport.php?bugid=\3">bug \3</a>', $comment);
                        $comment = preg_replace('#(https?://|www\.)\S+#i', '<a href="\0">\0</a>', $comment);
                }
-               
+
                if ($this->registry->options['allowhtml'])
                {
                        $this->set('comment_parsed', nl2br($this->registry->unsanitize($comment)));
@@ -98,7 +98,7 @@ class CommentAPI extends API
                        $this->set('comment_parsed', nl2br($comment));
                }
        }
-       
+
        // ###################################################################
        /**
        * Pre-update
@@ -109,7 +109,7 @@ class CommentAPI extends API
        {
                $this->set_comment_parsed();
        }
-       
+
        // ###################################################################
        /**
        * Pre-delete
index 1fdbc067e857192b37349fc6802c7fedfc64b738..b927f214b76021eaaf715a43302dc04c78e29916 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class FieldAPI extends API
 {
@@ -52,21 +52,21 @@ class FieldAPI extends API
                'usedefault'    => array(TYPE_BOOL,             REQ_NO),
                'maxlength'             => array(TYPE_UINT,             REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'bugfield';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * A static method that is used to return an array of all the allowed
@@ -86,7 +86,7 @@ class FieldAPI extends API
                        'input_checkbox'        => T('Checkbox Flag'),
                        'select_single'         => T('Drop-Down Menu'),
                );
-               
+
                if ($type == null)
                {
                        return $types;
@@ -96,7 +96,7 @@ class FieldAPI extends API
                        return $types["$type"];
                }
        }
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -107,7 +107,7 @@ class FieldAPI extends API
        {
                build_user_help();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -118,7 +118,7 @@ class FieldAPI extends API
        {
                build_user_help();
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
@@ -131,10 +131,10 @@ class FieldAPI extends API
                $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "bugfieldpermission WHERE fieldid = " . $this->values['fieldid']);
                $this->registry->db->query("ALTER TABLE " . TABLE_PREFIX . "bug DROP custom" . $this->values['fieldid']);
                $this->registry->db->query("OPTIMIZE TABLE " . TABLE_PREFIX . "bug");
-               
+
                build_user_help();
        }
-       
+
        // ###################################################################
        /**
        * Verify: type
@@ -149,7 +149,7 @@ class FieldAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: selects
@@ -178,7 +178,7 @@ class FieldAPI extends API
                                }
                        }
                }
-               
+
                return true;
        }
 }
index ace116b1d2efb13f2f52afef33b5984f0618f4f7..f03d1cea958af6db1b0c96ab16dec78d720b6a5c 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class LanguageAPI extends API
 {
@@ -47,21 +47,21 @@ class LanguageAPI extends API
                'userselect'    => array(TYPE_BOOL,             REQ_NO),
                'langcode'              => array(TYPE_STR,              REQ_YES)
        );
-       
+
        /**
        * Table
        * @var  string
        * @access       private
        */
        var $table = 'language';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -72,7 +72,7 @@ class LanguageAPI extends API
        {
                build_languages();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -83,7 +83,7 @@ class LanguageAPI extends API
        {
                build_languages();
        }
-       
+
        // ###################################################################
        /**
        * Pre-delete
@@ -95,13 +95,13 @@ class LanguageAPI extends API
                {
                        $this->error(T('At least one language needs to be present. Deleting this language would violate that.'));
                }
-               
+
                if ($this->registry->options['defaultlanguage'] == $this->values['languageid'])
                {
                        $this->error(T('You cannot delete the default language. Please select another language to be the default language and then delete this one.'));
                }
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
@@ -112,7 +112,7 @@ class LanguageAPI extends API
        {
                build_languages();
        }
-       
+
        // ###################################################################
        /**
        * Verify: direction
index 216f4f826200f82708bbdb3ba1707a8966eaacac..202700320a07d5e6cfc748d1fd64d8a7ca63fe0c 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class PriorityAPI extends API
 {
@@ -44,21 +44,21 @@ class PriorityAPI extends API
                'priority'              => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
                'displayorder'  => array(TYPE_INT,              REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'priority';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -69,7 +69,7 @@ class PriorityAPI extends API
        {
                build_priorities();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -80,7 +80,7 @@ class PriorityAPI extends API
        {
                build_priorities();
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
index ada17fec6df0e47e15582c9435144ec983f32e9f..a90f90b5aa0a94b01e8e741a29fcb78d8ec5ccea 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class ResolutionAPI extends API
 {
@@ -44,21 +44,21 @@ class ResolutionAPI extends API
                'resolution'    => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
                'displayorder'  => array(TYPE_INT,              REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'resolution';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -69,7 +69,7 @@ class ResolutionAPI extends API
        {
                build_resolutions();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -80,7 +80,7 @@ class ResolutionAPI extends API
        {
                build_resolutions();
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
index 01a4a54834d022e1221d2f89ee21eb7741020394..f2f773dac2ad2dd55048d75463809bdc33b938f2 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class SeverityAPI extends API
 {
@@ -44,21 +44,21 @@ class SeverityAPI extends API
                'severity'              => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
                'displayorder'  => array(TYPE_INT,              REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'severity';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -69,7 +69,7 @@ class SeverityAPI extends API
        {
                build_severities();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -80,7 +80,7 @@ class SeverityAPI extends API
        {
                build_severities();
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
index 898f6dce0e868a3e8fdccb803927c1c5bb035323..609321bedbc32a4bc8ddfcadc8ac9c9dd5d1f35b 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class StatusAPI extends API
 {
@@ -45,21 +45,21 @@ class StatusAPI extends API
                'color'                 => array(TYPE_STR,              REQ_NO),
                'displayorder'  => array(TYPE_INT,              REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'status';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -70,7 +70,7 @@ class StatusAPI extends API
        {
                build_statuses();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -81,7 +81,7 @@ class StatusAPI extends API
        {
                build_statuses();
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
index 9f316379d3d9ef13439e007d9609593d26c357f2..6ade4a2a47066a26d39942f676828c1eff7ee87c 100644 (file)
@@ -31,7 +31,7 @@ require_once('./includes/class_sort.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class UserAPI extends API
 {
@@ -60,21 +60,21 @@ class UserAPI extends API
                'columnoptions'         => array(TYPE_STR,      REQ_NO,         ':self'),
                'authid'                        => array(TYPE_STR,      REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'user';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Set field: salt
@@ -85,7 +85,7 @@ class UserAPI extends API
        {
                $this->set('salt', $this->registry->funct->rand(array(1, 15)));
        }
-       
+
        // ###################################################################
        /**
        * Set field: authkey
@@ -96,7 +96,7 @@ class UserAPI extends API
        {
                $this->set('authkey', $this->registry->funct->rand());
        }
-       
+
        // ###################################################################
        /**
        * Pre-insert
@@ -107,7 +107,7 @@ class UserAPI extends API
        {
                $this->set('password', md5(md5($this->values['password']) . md5($this->values['salt'])));
        }
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -130,7 +130,7 @@ class UserAPI extends API
                ");
                build_assignedto();
        }
-       
+
        // ###################################################################
        /**
        * Verify: email
@@ -143,7 +143,7 @@ class UserAPI extends API
                {
                        return $ne;
                }
-               
+
                if (!$this->registry->funct->is_valid_email($this->values['email']))
                {
                        return T('The specified email is invalid.');
@@ -154,7 +154,7 @@ class UserAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: displayname
@@ -167,14 +167,14 @@ class UserAPI extends API
                {
                        return $ne;
                }
-               
+
                if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE displayname = '" . $this->registry->db->escape_string($this->values['displayname']) . "' AND userid <> " . $this->registry->clean($this->values['userid'], TYPE_UINT)))
                {
                        return T('That display name is already in use by another user.');
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: usergroupid
@@ -189,7 +189,7 @@ class UserAPI extends API
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: groupids
@@ -204,7 +204,7 @@ class UserAPI extends API
                        $groups = explode(',', $this->values['groupids']);
                }
                $groups = $this->registry->funct->array_strip_empty($groups);
-               
+
                foreach ($groups AS $group)
                {
                        if (!isset($this->registry->datastore['usergroup']["$group"]))
@@ -212,12 +212,12 @@ class UserAPI extends API
                                return false;
                        }
                }
-               
+
                $this->values['groupids'] = implode(',', $groups);
-               
+
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Pre-update
@@ -228,7 +228,7 @@ class UserAPI extends API
        {
                $this->set_condition();
                $this->fetch();
-               
+
                if ($this->values['password'] == '')
                {
                        $this->set('password', $this->objdata['password']);
@@ -239,7 +239,7 @@ class UserAPI extends API
                        $this->set('password', md5(md5($this->values['password']) . md5($this->objdata['salt'])));
                }
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -257,13 +257,13 @@ class UserAPI extends API
                        $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET lastpostbyname = '$username' WHERE lastpostby = $id");
                        $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET hiddenlastpostbyname = '$username' WHERE hiddenlastpostby = $id");
                }
-               
+
                if (isset($this->values['displayname']) OR isset($this->values['email']))
                {
                        build_assignedto();
                }
        }
-       
+
        // ###################################################################
        /**
        * Pre-delete
@@ -276,7 +276,7 @@ class UserAPI extends API
                {
                        $this->error(T('You cannot delete your own account!'));
                }
-               
+
                if ($this->values['usergroupid'] == 6)
                {
                        $count = $this->registry->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE usergroupid = 6 AND userid <> " . $this->values['userid']);
@@ -286,7 +286,7 @@ class UserAPI extends API
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
@@ -300,10 +300,10 @@ class UserAPI extends API
                $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $this->values['userid']);
                $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $this->values['userid']);
                $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . $this->values['userid']);
-               
+
                build_assignedto();
        }
-       
+
        // ###################################################################
        /**
        * Verify: hidestatuses
@@ -316,10 +316,10 @@ class UserAPI extends API
                {
                        $this->set('hidestatuses', implode(',', $this->values['hidestatuses']));
                }
-               
+
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: defaultsortkey
@@ -332,10 +332,10 @@ class UserAPI extends API
                {
                        return false;
                }
-               
+
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: defaultsortas
@@ -348,10 +348,10 @@ class UserAPI extends API
                {
                        return false;
                }
-               
+
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Verify: columnoptions
index 5b8093aee9657e321a7f63b666dfc9ee805e6588..cca65a67ee1728e3507f95852eb22436c858ff49 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class UsergroupAPI extends API
 {
@@ -45,21 +45,21 @@ class UsergroupAPI extends API
                'displaytitle'  => array(TYPE_STR,              REQ_NO),
                'permissions'   => array(TYPE_UINT,             REQ_NO)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'usergroup';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -70,7 +70,7 @@ class UsergroupAPI extends API
        {
                build_usergroups();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -82,7 +82,7 @@ class UsergroupAPI extends API
                build_usergroups();
                build_assignedto();
        }
-       
+
        // ###################################################################
        /**
        * Pre-delete
@@ -96,7 +96,7 @@ class UsergroupAPI extends API
                        return T('You can\'t delete a default usergroup.');
                }
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
index 315acbae081cc4033993ebb5e27b80ced51f7974..739e9a8c4aa469343816c982b5e9cef6f16d42cf 100644 (file)
@@ -30,7 +30,7 @@ require_once('./includes/functions_datastore.php');
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class UserHelpAPI extends API
 {
@@ -44,21 +44,21 @@ class UserHelpAPI extends API
                'title'         => array(TYPE_STR,              REQ_YES,        'verify_noempty'),
                'body'          => array(TYPE_STR,              REQ_YES)
        );
-       
+
        /**
        * Database table
        * @var  string
        * @access       private
        */
        var $table = 'fieldhelp';
-       
+
        /**
        * Table prefix
        * @var  string
        * @access       private
        */
        var $prefix = TABLE_PREFIX;
-       
+
        // ###################################################################
        /**
        * A static function that returns an array of all the keystrings that
@@ -87,7 +87,7 @@ class UserHelpAPI extends API
                        'columnorder'
                );
        }
-       
+
        // ###################################################################
        /**
        * Pre-insert
@@ -98,10 +98,10 @@ class UserHelpAPI extends API
        {
                if (($err = $this->verify_keystring()) !== true)
                {
-                       $this->error($err);     
+                       $this->error($err);
                }
        }
-       
+
        // ###################################################################
        /**
        * Post-insert
@@ -112,7 +112,7 @@ class UserHelpAPI extends API
        {
                build_user_help();
        }
-       
+
        // ###################################################################
        /**
        * Post-update
@@ -123,7 +123,7 @@ class UserHelpAPI extends API
        {
                build_user_help();
        }
-       
+
        // ###################################################################
        /**
        * Pre-delete
@@ -131,14 +131,14 @@ class UserHelpAPI extends API
        * @access       private
        */
        function pre_delete()
-       {       
+       {
                if (in_array($this->values['keystring'], UserHelpAPI::not_able_to_delete()))
                {
                        return false;
                }
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Post-delete
@@ -149,7 +149,7 @@ class UserHelpAPI extends API
        {
                build_user_help();
        }
-       
+
        // ###################################################################
        /**
        * Verify: keystring
@@ -162,17 +162,17 @@ class UserHelpAPI extends API
                {
                        return $ne;
                }
-               
+
                if (preg_match('#[^a-z0-9_]#', $this->values['keystring']))
                {
                        return T('The unique key can only contain lowercase letters, underscores, and numbers.');
                }
-               
+
                if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = '" . $this->registry->escape($this->values['keystring']) . "'"))
                {
                        return T('The unique key must be unique.');
                }
-               
+
                return true;
        }
 }
index ace39cb7989e601e3a29a4e8133b36a523110fc7..367e13ef167b69efd4bb987e21a0aaedd121337e 100644 (file)
@@ -40,31 +40,31 @@ class Authentication
        * @var object
        */
        var $authDb;
-       
+
        /**
        * The database connection to the BUGDAR database
        * @var object
        */
        var $db;
-       
+
        /**
        * The Bugdar registry
        * @var object
        */
        var $registry;
-       
+
        /**
        * Array of user data from the AUTHENTICATION database
        * @var array
        */
        var $authUser;
-       
+
        /**
        * Array of user data from the BUGDAR database
        * @var array
        */
        var $bugdarUser;
-       
+
        /**
        * Mapping of Bugdar fields to authentication database fields; these will be synced between databases upon login.
        * AT THE VERY MINIMUM, YOU MUST MAP THESE FIELDS:
@@ -75,7 +75,7 @@ class Authentication
                'displayname'   => null,
                'email'                 => null,
        );
-       
+
        // ###################################################################
        /**
        * Constructor
@@ -83,15 +83,15 @@ class Authentication
        function __construct()
        {
                global $bugsys;
-               
+
                $this->registry =& $bugsys;
                $this->db =& $bugsys->db;
-               
+
                $this->registry->debug('authentication system: ' . get_class($this));
-               
+
                $this->_setupDatabase();
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -100,7 +100,7 @@ class Authentication
        {
                $this->__construct();
        }
-       
+
        // ###################################################################
        /**
        * Returns the information array for the Bugdar user. This must be
@@ -110,7 +110,7 @@ class Authentication
        {
                return $this->bugdarUser;
        }
-       
+
        // ###################################################################
        /**
        * Sets up the database to authenticate against. You can create a new
@@ -121,7 +121,7 @@ class Authentication
        {
                // connect to the DB
                $this->authDb = new DB_MySQL($this->registry);
-               
+
                include 'includes/auth/config.php';
                $this->authDb->connect(
                        $config['auth']['dbServer'],
@@ -131,21 +131,21 @@ class Authentication
                        false
                );
        }
-       
+
        // ###################################################################
        /**
        * Returns the sanitized value of the user ID or unique identifier
        * found in the cookie of an already-authenticated user.
        */
        function _fetchCookieUniqueId() {}
-       
+
        // ###################################################################
        /**
        * Returns the sanitized value of the authentication key or cookie-safe
        * password found in the cookies of an already-authenticated user.
        */
        function _fetchCookiePassword() {}
-       
+
        // ###################################################################
        /**
        * Returns an array of user data fetched using the user information
@@ -153,14 +153,14 @@ class Authentication
        * the authentication information, but only fetching it.
        */
        function _fetchUserUsingCookies() {}
-       
+
        // ###################################################################
        /**
        * Returns TRUE if the cookie data values are valid in the data array
        * returned from _fetchUserUsingCookies(), and FALSE if they are not.
        */
        function _verifyCookieData() {}
-       
+
        // ###################################################################
        /**
        * Authenticates the user using cookie data. You shouldn't need to
@@ -173,14 +173,14 @@ class Authentication
                {
                        return false;
                }
-               
+
                $this->authUser = $this->_fetchUserUsingCookies();
                if (!$this->authUser)
                {
                        $this->authUser = null;
                        return false;
                }
-               
+
                if ($this->_verifyCookieData())
                {
                        $this->_setCookies(true);
@@ -198,14 +198,14 @@ class Authentication
                        return false;
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns an array with the authentication user information, found
        * by the unique login identifier passed to the function.
        */
        function _fetchUserWithIdentifier($string) {}
-       
+
        // ###################################################################
        /**
        * Verifies that the authUser's password matches the plain-text password
@@ -213,7 +213,7 @@ class Authentication
        * the plaintext to the hashed password and the result of the comparison.
        */
        function _verifyLoginUser($password) {}
-       
+
        // ###################################################################
        /**
        * Authenticates a user at login from two keys: an identifier and
@@ -225,13 +225,13 @@ class Authentication
        function authenticateLogin($string, $password, $sticky = false)
        {
                $this->authUser = $this->_fetchUserWithIdentifier($string);
-               
+
                if (!$this->authUser)
                {
                        $this->authUser = null;
                        return false;
                }
-               
+
                if ($this->_verifyLoginUser($password))
                {
                        $this->_setCookies($sticky);
@@ -245,7 +245,7 @@ class Authentication
                        return false;
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns the BUGDAR user array from the data in the AUTHENTICATION user
@@ -264,7 +264,7 @@ class Authentication
                }
                return $user;
        }
-       
+
        // ###################################################################
        /**
        * Creates a Bugdar user with the authentication details specified in
@@ -276,7 +276,7 @@ class Authentication
        function _createBugdarUser()
        {
                $user = new UserAPI($this->registry);
-               
+
                // if the email already exists in the DB, it must be the same person so just hook up the authid
                if ($check = $this->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->db->escape_string($this->authUser[ $this->fieldMap['email'] ]) . "'"))
                {
@@ -285,7 +285,7 @@ class Authentication
                        $user->set('authid', $this->authUser[ $this->fieldMap['authid'] ]);
                        $user->update();
                        $user->fetch();
-                       
+
                        return $user->objdata;
                }
                else
@@ -298,11 +298,11 @@ class Authentication
                        $user->set('usergroupid', 2);
                        $user->set('password', $this->registry->funct->rand());
                        $user->insert();
-                       
+
                        return $user->values;
                }
        }
-       
+
        // ###################################################################
        /**
        * Syncs a Bugdar user's fieldMap'ed values to the authentication DB's
@@ -315,9 +315,9 @@ class Authentication
                $fields = $this->fieldMap;
                unset($fields['authid']);
                unset($fields['password']);
-               
+
                $change = false;
-               
+
                $user = new UserAPI($this->registry);
                $user->set('userid', $this->bugdarUser['userid']);
                $user->set_condition();
@@ -333,17 +333,17 @@ class Authentication
                {
                        $user->update();
                }
-               
+
                return $change;
        }
-       
+
        // ###################################################################
        /**
        * Responsible for unsetting all authentication cookies because they
        * are invalid
        */
        function clearCookies() {}
-       
+
        // ###################################################################
        /**
        * Sets the authentication cookies; this is done both at login and
index 693b98cc29b244c87c39d74e52f2b7eb6141182e..ed171d2189b2a633c22091e1147c50fe98a7df1a 100644 (file)
@@ -39,63 +39,63 @@ class AuthenticationDefault extends Authentication
        {
                $this->authDb = &$this->db;
        }
-       
+
        // ###################################################################
        function _fetchCookieUniqueId()
        {
                return $this->registry->input_clean(COOKIE_PREFIX . 'userid', TYPE_UINT);
        }
-       
+
        // ###################################################################
        function _fetchCookiePassword()
        {
                return $this->registry->in[COOKIE_PREFIX . 'authkey'];
        }
-       
+
        // ###################################################################
        function _fetchUserUsingCookies()
        {
                return $this->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $this->_fetchCookieUniqueId());
        }
-       
+
        // ###################################################################
        function _verifyCookieData()
        {
                return ($this->authUser['authkey'] == $this->_fetchCookiePassword());
        }
-       
+
        // ###################################################################
        function _setCookies($sticky = false)
        {
                $this->registry->funct->cookie(COOKIE_PREFIX . 'userid', $this->authUser['userid'], $sticky);
        $this->registry->funct->cookie(COOKIE_PREFIX . 'authkey', $this->authUser['authkey'], $sticky);
        }
-       
+
        // ###################################################################
        function clearCookies()
        {
                $this->registry->funct->cookie(COOKIE_PREFIX . 'userid');
                $this->registry->funct->cookie(COOKIE_PREFIX . 'authkey');
        }
-       
+
        // ###################################################################
        function _fetchBugdarUserFromAuthUser()
        {
                return $this->authUser;
        }
-       
+
        // ###################################################################
        function _fetchUserWithIdentifier($email)
        {
                return $this->authDb->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->authDb->escape_string($email) . "'");
        }
-       
+
        // ###################################################################
        function _verifyLoginUser($password)
        {
                return ($this->authUser['password'] == md5(md5($password) . md5($this->authUser['salt'])));
        }
-       
+
        // ###################################################################
        function _syncBugdarUser() {}
 }
index c834f086f3ab20b84fd4a95e8dad556e99d7c5a1..95c8767d29672a5c76fa966e53bd20b8d89548a0 100644 (file)
@@ -40,7 +40,7 @@ class AuthenticationDrupal extends Authentication
                'displayname'   => 'name',
                'email'                 => 'mail',
        );
-       
+
        /**
        * The cookie name to use for Drupal. Leaving this NULL will get it from session_name()
        */
@@ -50,25 +50,25 @@ class AuthenticationDrupal extends Authentication
        function _setupDatabase()
        {
                parent::_setupDatabase();
-               
+
                // check and see if we need to call session_name()
                include 'includes/auth/config.php';
                $this->cookieName = $config['auth']['Drupal']['cookieName'];
                $this->cookieName = ($this->cookieName == null ? session_name() : $this->cookieName);
        }
-       
+
        // ###################################################################
        function _fetchCookieUniqueId()
        {
                return $this->registry->in[ $this->cookieName ];
        }
-       
+
        // ###################################################################
        function _fetchCookiePassword()
        {
                return true;
        }
-       
+
        // ###################################################################
        function _fetchUserUsingCookies()
        {
@@ -79,19 +79,19 @@ class AuthenticationDrupal extends Authentication
                }
                return $this->authDb->query_first("SELECT * FROM users WHERE uid = " . $session['uid']);
        }
-       
+
        // ###################################################################
        function _verifyCookieData()
        {
                return ($this->_fetchUserUsingCookies() != false);
        }
-       
+
        // ###################################################################
        function _fetchUserWithIdentifier($string)
        {
                return $this->authDb->query_first("SELECT * FROM users WHERE name = '" . $this->authDb->escape_string($string) . "'");
        }
-       
+
        // ###################################################################
        function _verifyLoginUser($password)
        {
@@ -104,7 +104,7 @@ class AuthenticationDrupal extends Authentication
                $this->registry->funct->cookie($this->cookieName);
                $this->authDb->query("DELETE FROM sessions WHERE sid = '" . $this->authDb->escape_string($this->_fetchCookieUniqueId()) . "'");
        }
-       
+
        // ###################################################################
        function _setCookies($permanent = false)
        {
index 156b08ae7be04c86ff1faadfa49198533daea00c..7628127037f89cf85276aa4cf2ae7326b07c9546 100644 (file)
@@ -42,66 +42,66 @@ class AuthenticationIPB2 extends Authentication
                'displayname'   => 'name',
                'email'                 => 'email'
        );
-       
+
        /**
         * IPB2 table prefix
         * @var string
         */
        var $tablePrefix;
-       
+
        /**
         * Cookie prefix
         * @var string
         */
        var $cookiePrefix;
-       
+
        // ###################################################################
        function _setupDatabase()
        {
                parent::_setupDatabase();
-               
+
                include 'includes/auth/config.php';
                $this->tablePrefix = $config['auth']['IPB2']['tablePrefix'];
                $this->cookiePrefix = $config['auth']['IPB2']['cookiePrefix'];
        }
-       
+
        // ###################################################################
        function _fetchCookieUniqueId()
        {
                return $this->registry->input_clean($this->cookiePrefix . 'member_id', TYPE_UINT);
        }
-       
+
        // ###################################################################
        function _fetchCookiePassword()
        {
                return $this->registry->in[$this->cookiePrefix . 'pass_hash'];
        }
-       
+
        // ###################################################################
        function _fetchUserUsingCookies()
        {
                return $this->authDb->query_first("SELECT * FROM {$this->tablePrefix}members WHERE id = " . $this->_fetchCookieUniqueId());
        }
-       
+
        // ###################################################################
        function _verifyCookieData()
        {
                return ($this->_fetchCookiePassword() == $this->authUser['member_login_key']);
        }
-       
+
        // ###################################################################
        function _fetchUserWithIdentifier($username)
        {
                return $this->authDb->query_first("SELECT * FROM {$this->tablePrefix}members WHERE name = '" . $this->authDb->escape_string($username) . "'");
        }
-       
+
        // ###################################################################
        function _verifyLoginUser($password)
        {
                $cvg = $this->authDb->query_first("SELECT * FROM {$this->tablePrefix}members_converge WHERE converge_email = '" . $this->authUser['email'] . "'");
                return (md5(md5($cvg['converge_pass_salt']) . md5($password)) == $cvg['converge_pass_hash']);
        }
-       
+
        // ###################################################################
        function clearCookies()
        {
@@ -111,18 +111,18 @@ class AuthenticationIPB2 extends Authentication
                $this->authDb->query("DELETE FROM {$this->tablePrefix}sessions WHERE id = '" . $this->authDb->escape_string($this->registry->in[$this->cookiePrefix . 'session_id']) . "'");
                $this->registry->funct->cookie($this->cookiePrefix . 'session_id');
        }
-       
+
        // ###################################################################
        function _setCookies($sticky = false)
        {
                $this->registry->funct->cookie($this->cookiePrefix . 'member_id', $this->authUser['id']);
                $this->registry->funct->cookie($this->cookiePrefix . 'pass_hash', $this->authUser['member_login_key']);
-               
+
                include 'includes/auth/config.php';
                $ip = explode('.', $_SERVER['REMOTE_ADDR']);
                $stronghold = md5(md5($this->authUser['id'] . '-' . $ip[0] . '-' . $ip[1] . '-' . $this->authUser['member_login_key']) . md5($config['auth']['dbPassword'] . $config['auth']['dbUser']));
                $this->registry->funct->cookie($this->cookiePrefix . 'ipb_stronghold', $stronghold);
-               
+
                $this->registry->funct->cookie($this->cookiePrefix . 'session_id');
        }
 }
index 7d4a11525627f4b41456c824659b7ed6e0abf46e..1dce1c9183fc2dc091fde20b24a92431270ee5ea 100644 (file)
@@ -43,42 +43,42 @@ class AuthenticationPhpbb2 extends Authentication
                'displayname'   => 'username',
                'email'                 => 'user_email'
        );
-       
+
        /**
        * Database table prefix
        * @var string
        */
        var $phpBBTablePrefix = 'phpbb2_';
-       
+
        /**
        * The cookie name that is set in phpBB -> Administration -> General Admin -> Configuration -> Cookie Settings -> Cookie Name
        * @var string
        */
        var $cookieName = 'phpbb2mysql';
-       
+
        // ###################################################################
        function _setupDatabase()
        {
                parent::_setupDatabase();
-               
+
                include 'includes/auth/config.php';
                $this->phpBBTablePrefix = $config['auth']['phpBB2']['tablePrefix'];
                $this->cookieName = $config['auth']['phpBB2']['cookieName'];
        }
-       
+
        // ###################################################################
        function _fetchCookieUniqueId()
        {
                $val = $this->registry->in[$this->cookieName . '_sid'];
                return (!$val ? -1 : $val); // hack so we don't do stupid things but can still create a session
        }
-       
+
        // ###################################################################
        function _fetchCookiePassword()
        {
                return true;
        }
-       
+
        // ###################################################################
        function _fetchUserUsingCookies()
        {
@@ -102,19 +102,19 @@ class AuthenticationPhpbb2 extends Authentication
                        return $this->authDb->query_first("SELECT * FROM {$this->phpBBTablePrefix}users WHERE user_id = " . $session['session_user_id']);
                }
        }
-       
+
        // ###################################################################
        function _verifyCookieData()
        {
                return ($this->_fetchUserUsingCookies() != false);
        }
-       
+
        // ###################################################################
        function _fetchUserWithIdentifier($string)
        {
                return $this->authDb->query_first("SELECT * FROM {$this->phpBBTablePrefix}users WHERE username = '" . $this->authDb->escape_string($string) . "'");
        }
-       
+
        // ###################################################################
        function _verifyLoginUser($password)
        {
@@ -128,7 +128,7 @@ class AuthenticationPhpbb2 extends Authentication
                $this->registry->funct->cookie($this->cookieName . '_sid');
                $this->authDb->query("DELETE FROM {$this->phpBBTablePrefix}sessions WHERE session_id = '" . $this->authDb->escape_string($this->_fetchCookieUniqueId()) . "'");
        }
-       
+
        // ###################################################################
        function _setCookies($permanent = false)
        {
@@ -147,7 +147,7 @@ class AuthenticationPhpbb2 extends Authentication
                                '$sid', " . $this->authUser['user_id'] . ", " . time() . ", " . time() . ", 1
                        )"
                );
-               
+
                $this->authDb->query("UPDATE {$this->phpBBTablePrefix}users SET user_session_time = " . time() . ", user_lastvisit = " . time() . " WHERE user_id = " . $this->authUser['user_id']);
        }
 }
index c1d7555c2ba5fdc29083b992cc7a0cb3807c2ba6..86ac6be560b5a2feee1a33aa0f81851771725a23 100644 (file)
@@ -41,13 +41,13 @@ class AuthenticationVbulletin extends Authentication
        * @var string
        */
        var $licenseKey = 'LXXXXXXX';
-       
+
        /**
        * The table prefix for all of vBulletin's tables
        * @var string
        */
        var $vBTablePrefix = '';
-       
+
        /**
        * Fields that map Bugdar fields to vBulletin fields
        * @var string
@@ -58,48 +58,48 @@ class AuthenticationVbulletin extends Authentication
                'timezone'              => 'timezoneoffset',
                'displayname'   => 'username'
        );
-       
+
        // ###################################################################
        function _setupDatabase()
        {
                parent::_setupDatabase();
-               
+
                include 'includes/auth/config.php';
                $this->licenseKey = $config['auth']['vBulletin3']['licenseKey'];
                $this->vBTablePrefix = $config['auth']['vBulletin3']['tablePrefix'];
        }
-       
+
        // ###################################################################
        function _fetchCookieUniqueId()
        {
                return $this->registry->input_clean('bbuserid', TYPE_UINT);
        }
-       
+
        // ###################################################################
        function _fetchCookiePassword()
        {
                return $this->registry->in['bbpassword'];
        }
-       
+
        // ###################################################################
        function _fetchUserUsingCookies()
        {
                return $this->authDb->query_first("SELECT * FROM {$this->vBTablePrefix}user WHERE userid = " . $this->_fetchCookieUniqueId());
        }
-       
+
        // ###################################################################
        function _verifyCookieData()
        {
                return (md5($this->authUser['password'] . $this->licenseKey) == $this->_fetchCookiePassword());
        }
-       
+
        // ###################################################################
        function _setCookies($sticky = false)
        {
                $this->registry->funct->cookie('bbuserid', $this->authUser['userid'], $sticky);
        $this->registry->funct->cookie('bbpassword', md5($this->authUser['password'] . $this->licenseKey), $sticky);
        }
-       
+
        // ###################################################################
        function clearCookies()
        {
@@ -112,7 +112,7 @@ class AuthenticationVbulletin extends Authentication
        {
                return $this->authDb->query_first("SELECT * FROM {$this->vBTablePrefix}user WHERE username = '" . $this->authDb->escape_string($username) . "'");
        }
-       
+
        // ###################################################################
        function _verifyLoginUser($password)
        {
index eef6d50db561bb436e4a11179eaa30fe53502003..8d7105db9a7e4030a733e6b3c2cf22fc235b48a0 100644 (file)
@@ -29,7 +29,7 @@
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class NavLinks
 {
@@ -42,14 +42,14 @@ class NavLinks
        function optionsPages()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'options-pages', 'options', T('Options'), null);
                $navigator->add_component('link', 'options-pages-home', 'options-pages', T('Home'), 'index.php');
                $navigator->add_component('link', 'options-pages-settings', 'options-pages', T('Bugdar Settings'), 'setting.php');
                $navigator->add_component('link', 'options-pages-languages', 'options-pages', T('Languages'), 'language.php');
                $navigator->add_component('link', 'options-pages-userhelp', 'options-pages', T('User Help Items'), 'userhelp.php');
        }
-       
+
        // ###################################################################
        /**
        * Adding a new language
@@ -59,11 +59,11 @@ class NavLinks
        function languagesAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'options-languages', 'options', T('Languages'), null);
                $navigator->add_component('link', 'options-languages-add', 'options-languages', T('Add New Language'), 'language.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit a language
@@ -75,12 +75,12 @@ class NavLinks
        function languagesEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::languagesAdd();
                $navigator->add_component('link', 'options-languages-edit', 'options-languages', T('Edit Language'), 'language.php?do=edit&amp;languageid=' . $id);
                $navigator->add_component('link', 'options-languages-delete', 'options-languages', T('Delete'), 'language.php?do=delete&amp;languageid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Adding a new user help item
@@ -90,11 +90,11 @@ class NavLinks
        function userhelpAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'options-userhelp', 'options', T('User Help Items'), null);
                $navigator->add_component('link', 'options-userhelp-add', 'options-userhelp', T('Add New Item'), 'userhelp.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Adding a new product
@@ -104,12 +104,12 @@ class NavLinks
        function productsAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'products', 'products', T('Products'), null);
                $navigator->add_component('link', 'products-manage', 'products', T('Manage Products'), 'product.php');
                $navigator->add_component('link', 'products-add', 'products', T('Add New Product'), 'product.php?do=addproduct');
        }
-       
+
        // ###################################################################
        /**
        * Editing a product
@@ -121,14 +121,14 @@ class NavLinks
        function productsEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::productsAdd();
                $navigator->add_component('section', 'products-edit', 'products', T('Edit Product'), null);
                $navigator->add_component('link', 'products-edit', 'products-edit', T('Edit Product'), 'product.php?do=editproduct&amp;productid=' . $id);
                $navigator->add_component('link', 'products-edit-version', 'products-edit', T('Add New Version'), 'product.php?do=addversion&amp;productid=' . $id);
                $navigator->add_component('link', 'products-edit-delete', 'products-edit', T('Delete Product'), 'product.php?do=deleteproduct&amp;productid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Fields tab pages
@@ -138,7 +138,7 @@ class NavLinks
        function fieldsPages()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'fields-pages', 'fields', T('Fields'), null);
                $navigator->add_component('link', 'fields-pages-fields', 'fields-pages',  T('Custom Fields'), 'field.php');
                $navigator->add_component('link', 'fields-pages-priorities', 'fields-pages', T('Priorities'), 'priority.php');
@@ -147,7 +147,7 @@ class NavLinks
                $navigator->add_component('link', 'fields-pages-statuses', 'fields-pages', T('Statuses'), 'status.php');
                $navigator->add_component('link', 'fields-pages-automations', 'fields-pages', T('Automations'), 'automation.php');
        }
-       
+
        // ###################################################################
        /**
        * Adding an new custom field
@@ -157,11 +157,11 @@ class NavLinks
        function fieldsAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'fields', 'fields', T('Custom Fields'), null);
                $navigator->add_component('link', 'fields-add', 'fields', T('Add New Custom Field'), 'field.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit a custom field
@@ -173,11 +173,11 @@ class NavLinks
        function fieldsEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::fieldsAdd();
                $navigator->add_component('link', 'fields-delete', 'fields', T('Delete'), 'field.php?do=delete&amp;fieldid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Adding an new priority
@@ -187,11 +187,11 @@ class NavLinks
        function prioritiesAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'priorities', 'fields', T('Priorities'), null);
                $navigator->add_component('link', 'priorities-add', 'priorities', T('Add New Priority'), 'priority.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit a priority
@@ -203,11 +203,11 @@ class NavLinks
        function prioritiesEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::prioritiesAdd();
                $navigator->add_component('link', 'priorities-delete', 'priorities', T('Delete'), 'priority.php?do=delete&amp;priorityid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Adding an new resolution
@@ -217,11 +217,11 @@ class NavLinks
        function resolutionsAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'resolutions', 'fields', T('Resolutions'), null);
                $navigator->add_component('link', 'resolutions-add', 'resolutions', T('Add New Resolution'), 'resolution.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit a resolution
@@ -233,11 +233,11 @@ class NavLinks
        function resolutionsEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::resolutionsAdd();
                $navigator->add_component('link', 'resolutions-delete', 'resolutions', T('Delete'), 'resolution.php?do=delete&amp;resolutionid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Adding an new severity
@@ -247,11 +247,11 @@ class NavLinks
        function severitiesAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'severities', 'fields', T('Severities'), null);
                $navigator->add_component('link', 'severities-add', 'severities', T('Add New Severity'), 'severity.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit a severity
@@ -263,11 +263,11 @@ class NavLinks
        function severitiesEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::severitiesAdd();
                $navigator->add_component('link', 'severities-delete', 'severities', T('Delete'), 'severity.php?do=delete&amp;severityid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Adding an new status
@@ -277,11 +277,11 @@ class NavLinks
        function statusesAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'statuses', 'fields', T('Severities'), null);
                $navigator->add_component('link', 'statuses-add', 'statuses', T('Add New Status'), 'status.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit a status
@@ -293,11 +293,11 @@ class NavLinks
        function statusesEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::statusesAdd();
                $navigator->add_component('link', 'statuses-delete', 'statuses', T('Delete'), 'status.php?do=delete&amp;statusid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Adding an new automation
@@ -307,11 +307,11 @@ class NavLinks
        function automationsAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'automations', 'fields', T('Automations'), null);
                $navigator->add_component('link', 'automations-add', 'automations', T('Add New Automation'), 'automation.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit an automation
@@ -323,11 +323,11 @@ class NavLinks
        function automationsEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::automationsAdd();
                $navigator->add_component('link', 'automations-delete', 'automations', T('Delete'), 'automation.php?do=delete&amp;actionid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * User tab pages
@@ -337,14 +337,14 @@ class NavLinks
        function usersPages()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'users-pages', 'users', T('Users &amp; Permissions'), null);
                $navigator->add_component('link', 'users-pages-users', 'users-pages', T('Users'), 'user.php');
                $navigator->add_component('link', 'users-pages-usergroups', 'users-pages', T('Usergroups'), 'usergroup.php');
                $navigator->add_component('link', 'users-pages-permissions', 'users-pages', T('Product-Level Permissions'), 'permission.php');
                $navigator->add_component('link', 'users-pages-purge', 'users-pages', T('Purge Inactive Users'), 'purge_inactive.php');
        }
-       
+
        // ###################################################################
        /**
        * Add a new user
@@ -354,12 +354,12 @@ class NavLinks
        function usersAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'users', 'users', T('Users'), null);
                $navigator->add_component('link', 'users-showall', 'users', T('Show All Users'), 'user.php?do=showall');
                $navigator->add_component('link', 'users-add', 'users', T('Add New User'), 'user.php?do=add');
        }
-       
+
        // ###################################################################
        /**
        * Edit a user
@@ -371,11 +371,11 @@ class NavLinks
        function usersEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::usersAdd();
                $navigator->add_component('link', 'users-delete', 'users', T('Delete'), 'user.php?do=delete&amp;userid=' . $id);
        }
-       
+
        // ###################################################################
        /**
        * Add a new usergroup
@@ -385,12 +385,12 @@ class NavLinks
        function usergroupsAdd()
        {
                global $navigator;
-               
+
                $navigator->add_component('section', 'usergroups', 'users', T('Usergroups'), null);
                $navigator->add_component('link', 'usergroups-add', 'usergroups', T('Add New Usergroup'), 'usergroup.php?do=add');
                $navigator->add_component('link', 'usergroups-approve', 'usergroups', T('Moderate Awaiting Users'), 'usergroup.php?do=approve');
        }
-       
+
        // ###################################################################
        /**
        * Edit a usergroup
@@ -402,7 +402,7 @@ class NavLinks
        function usergroupsEdit($id)
        {
                global $navigator;
-               
+
                NavLinks::usergroupsAdd();
                $navigator->add_component('link', 'usergroups-delete', 'usergroups', T('Delete'), 'usergroup.php?do=delete&amp;userid=' . $id);
        }
index 34e9286e99e6b844397ebdfea20986e81360b0cf..439b5a29afe42fa3e4899e7b2d8b746f4d45b0c1 100644 (file)
@@ -31,7 +31,7 @@
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class API_Error_Handler
 {
@@ -41,7 +41,7 @@ class API_Error_Handler
        * @access       private
        */
        var $object = null;
-       
+
        // ###################################################################
        /**
        * Constructor: set the actionable object
@@ -54,7 +54,7 @@ class API_Error_Handler
        {
                $this->object =& $obj;
        }
-       
+
        // ###################################################################
        /**
        * The user-end cumulative reporter requires that the class be
@@ -71,7 +71,7 @@ class API_Error_Handler
        {
                $this->object->addError($error);
        }
-       
+
        // ###################################################################
        /**
        * This calls the simple ISSO.Printer error message for the
index 7cb9b3e10d4434fcd464d4d5ecf8f5be206e08da..1365ed49e2423208c9669a394eb2f6304fd863ff 100644 (file)
@@ -36,7 +36,7 @@ DELETE FROM history WHERE field IN ('lastposttime', 'lastpostby', 'hiddenlastpos
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class Logging
 {
@@ -46,42 +46,42 @@ class Logging
        * @access       private
        */
        var $bugid = 0;
-       
+
        /**
        * Attachment ID
        * @var  integer
        * @access       private
        */
        var $attachmentid = 0;
-       
+
        /**
        * Comment ID
        * @var  integer
        * @access       private
        */
        var $commentid = 0;
-       
+
        /**
        * The original data to compare against
        * @var  array
        * @access       private
        */
        var $original = array();
-       
+
        /**
        * Modified data
        * @var  array
        * @access       private
        */
        var $modified = array();
-       
+
        /**
        * Compared/diff'd data
        * @var  array
        * @access       private
        */
        var $compared = array();
-       
+
        // ###################################################################
        /**
        * Sets the bug ID for the current logging instance
@@ -95,7 +95,7 @@ class Logging
                global $bugsys;
                $this->bugid = $bugsys->clean($id, TYPE_UINT);
        }
-       
+
        // ###################################################################
        /**
        * Sets the attachment ID for the current logging instance
@@ -109,7 +109,7 @@ class Logging
                global $bugsys;
                $this->attachmentid = $bugsys->clean($id, TYPE_UINT);
        }
-       
+
        // ###################################################################
        /**
        * Sets the current comment ID to be logged
@@ -123,7 +123,7 @@ class Logging
                global $bugsys;
                $this->commentid = $bugsys->clean($id, TYPE_UINT);
        }
-       
+
        // ###################################################################
        /**
        * Assigns data into the $this->original or $this->modified array based
@@ -142,7 +142,7 @@ class Logging
        {
                $array = ($orig ? 'original' : 'modified');
                $prefix .= '.';
-               
+
                if ($exclude == false)
                {
                        foreach ($fields AS $fname => $fdisplay)
@@ -151,7 +151,7 @@ class Logging
                                {
                                        $fname = $fdisplay;
                                }
-                               
+
                                $this->{$array}["$prefix$fdisplay"] = array('name' => $fname, 'value' => $data["$fname"]);
                        }
                }
@@ -166,7 +166,7 @@ class Logging
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Populates the $this->compared array as a diff between the original
@@ -184,7 +184,7 @@ class Logging
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Runs $this->compare_arrays() and then takes the result and prepares
@@ -195,9 +195,9 @@ class Logging
        function update_history()
        {
                global $bugsys;
-               
+
                $this->compare_arrays();
-               
+
                foreach ($this->compared AS $field => $values)
                {
                        $bugsys->db->query("
@@ -212,7 +212,7 @@ class Logging
                        ");
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns an array of the fields commonly ignored
index 6962c144c6760d66c3f76c497f72cde66d797d26..212735b30cb74c65feb40692214b0047d6686cb6 100644 (file)
@@ -27,14 +27,14 @@ class MessageReporter
        * @access       private
        */
        var $errors = array();
-       
+
        /**
        * The processed text for a compound error
        * @var  string
        * @access       private
        */
        var $errorBox = '';
-       
+
        // ###################################################################
        /**
        * Adds an error to the cumulative error list
@@ -47,7 +47,7 @@ class MessageReporter
        {
                $this->errors[] = $message;
        }
-       
+
        // ###################################################################
        /**
        * Returns TRUE if there are any errors from addError(), and FALSE if
@@ -62,17 +62,17 @@ class MessageReporter
                {
                        return false;
                }
-               
+
                $this->errorBox = "\n\n<ol style=\"list-style-type: decimal\">";
                foreach ($this->errors AS $err)
                {
                        $this->errorBox .= "\n\t<li>" . $err . "</li>";
                }
                $this->errorBox .= "\n</ol>";
-               
+
                return true;
        }
-       
+
        // ###################################################################
        /**
        * Throws an actual error. If an error text is passed, it takes
@@ -84,16 +84,16 @@ class MessageReporter
        {
                global $bugsys;
                global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
-               
+
                if ($error == null)
                {
                        $error = $this->errorBox;
                }
-               
+
                eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_error') . '");');
                exit;
        }
-       
+
        // ###################################################################
        /**
        * Throws a common no-permission error
@@ -102,7 +102,7 @@ class MessageReporter
        {
                $this->error(T('You do not have permission to access this page. If you think that this is an error, please contact an administrator.'));
        }
-       
+
        // ###################################################################
        /**
        * Performs a front-end redirect by either header or <meta>
@@ -114,17 +114,17 @@ class MessageReporter
        {
                global $bugsys;
                global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
-               
+
                if ($bugsys->options['redirectheaders'])
                {
                        header("Location: $url");
                        exit;
                }
-               
+
                eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_redirect') . '");');
                exit;
        }
-       
+
        // ###################################################################
        /**
        * Displays a fatal warning/notice that is usually not an error
@@ -135,11 +135,11 @@ class MessageReporter
        {
                global $bugsys;
                global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
-               
+
                eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");');
                exit;
        }
-       
+
        // ###################################################################
        /**
        * Displays a standard message template with extra confirm data on it
@@ -157,14 +157,14 @@ class MessageReporter
        {
                global $bugsys;
                global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
-               
+
                $show['confirm'] = true;
-               
+
                foreach ($arrextra AS $name => $value)
                {
                        $extra .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />' . "\n";
                }
-               
+
                eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");');
                exit;
        }
index 6ffcb0ae984a70c6cd4b924c30568cb72f7aec78..1a8a3b0b272d5029766aa454abcda4f00bfdaa76 100644 (file)
@@ -39,25 +39,25 @@ class MOReader
         * @var string
         */
        var $filename;
-       
+
        /**
         * The file pointer of the MO file
         * @var resource
         */
        var $file = null;
-       
+
        /**
         * Is the MO file a big endian one?
         * @var boolean
         */
        var $bigEndian = false;
-       
+
        /**
         * The string table as an array
         * @var array
         */
        var $strings = array();
-       
+
        /**
         * Creates a new MOReader given a path to a MO file
         */
@@ -66,10 +66,10 @@ class MOReader
                $this->filename = $filename;
                $this->_loadFile();
        }
-       
+
        /**
         * Returns the translated string for T, or the original if none exists
-        * 
+        *
         * @param       string  Native string to look up a translation for
         *
         * @return      string
@@ -82,10 +82,10 @@ class MOReader
                }
                return $this->strings[$str];
        }
-       
+
        /**
         * Reads $size number of bytes
-        * 
+        *
         * @param       integer Number of bytes to read
         *
         * @return      string
@@ -102,21 +102,21 @@ class MOReader
                        return unpack('V' . $size, $stream);
                }
        }
-       
+
        /**
         * Lodas the MO data information into the stirng table
         */
        function _loadFile()
        {
                global $bugsys;
-               
+
                $this->file = @fopen($this->filename, 'r');
                if (!$this->file)
                {
                        $bugsys->debug("could not open MO file {$this->filename}");
                        return;
                }
-               
+
                // read the magic number
                $stream = $this->_readBytes(1);
                $stream = dechex($stream[1]);
@@ -132,23 +132,23 @@ class MOReader
                {
                        trigger_error('Invalid MO file format');
                }
-               
+
                // read the revision (unused in MOs)
                $this->_readBytes(1);
-               
+
                // read the number of strings
                $count = $this->_readBytes(1);
                $count = $count[1];
-               
+
                // get the start positions of the original and translated tables
                $offsetO = $this->_readBytes(1);
                $offsetT = $this->_readBytes(1);
-               
+
                fseek($this->file, $offsetO[1]);
                $tableO = $this->_readBytes(2 * $count);
                fseek($this->file, $offsetT[1]);
                $tableT = $this->_readBytes(2 * $count);
-               
+
                for ($i = 0; $i < $count; $i++)
                {
                        if ($tableO[$i * 2 + 1] > 0)
@@ -156,14 +156,14 @@ class MOReader
                                fseek($this->file, $tableO[$i * 2 + 2]);
                                $O = fread($this->file, $tableO[$i * 2 + 1]);
                        }
-                       
+
                        if ($tableT[$i * 2 + 1] > 0)
                        {
                                fseek($this->file, $tableT[$i * 2 + 2]);
                                $this->strings[$O] = fread($this->file, $tableT[$i * 2 + 1]);
                        }
                }
-               
+
                fclose($this->file);
        }
 }
index 1457b3bfbb18eb8f7263dd4efab04eb0cc429faf..0ad92dd7023bc955b73e82c2151dee2f6bd9d62e 100644 (file)
 /**
 * Notification Center
 *
-* This class determines which emails need to be sent out based on user 
+* This class determines which emails need to be sent out based on user
 * options and bug changes, and then it sends said emails.
 *
 * @author              Blue Static
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class NotificationCenter
 {
@@ -39,28 +39,28 @@ class NotificationCenter
        * @access       private
        */
        var $bug = array();
-       
+
        /**
        * Original bug data
        * @var  array
        * @access       private
        */
        var $original = array();
-       
+
        /**
        * Modified bug data
        * @var  array
        * @access       private
        */
        var $modified = array();
-       
+
        /**
        * Global bugsys registry
        * @var  object
        * @access       private
        */
        var $registry = null;
-       
+
        /**
        * Role list: a list of user IDs with their relations to the bug
        * @var  array
@@ -74,21 +74,21 @@ class NotificationCenter
                'voter'                         => array(),
                'commenter'                     => array()
        );
-       
+
        /**
        * User cache list
        * @var  array
        * @access       private
        */
        var $users = array();
-       
+
        /**
        * A list of notices per-user that are combined together in NotificationCenter::finalize()
        * @var  array
        * @access       private
        */
        var $notices = array();
-       
+
        // ###################################################################
        /**
        * Constructor: set database objects
@@ -98,10 +98,10 @@ class NotificationCenter
        function __construct()
        {
                global $bugsys;
-               
+
                $this->registry =& $bugsys;
        }
-       
+
        // ###################################################################
        /**
        * (PHP 4) Constructor
@@ -112,7 +112,7 @@ class NotificationCenter
        {
                $this->__construct();
        }
-       
+
        // ###################################################################
        /**
        * Sets the bug data so that all methods in this class have access to
@@ -133,17 +133,17 @@ class NotificationCenter
                {
                        $this->bug = $original;
                }
-               
+
                $this->original = $original;
                $this->modified = $modified;
-               
+
                $this->roles['-notapplicable-'] = (sizeof($modified) > 0 ? array($original['assignedto'], $modified['assignedto']) : array($original['assignedto']));
                $this->roles['reporter'] = array($original['userid']);
                $this->roles['assignee'][] = (sizeof($modified) > 0 ? $modified['assignedto'] : $original['assignedto']);
-               
+
                $this->fetch_user_cache();
        }
-       
+
        // ###################################################################
        /**
        * Fetches all the users who could be related to the bug and sticks
@@ -158,25 +158,25 @@ class NotificationCenter
                {
                        $this->roles['-notapplicable-']["$newbug[userid]"] = $newbug['userid'];
                }
-               
+
                $favorites = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT));
                while ($fav = $this->registry->db->fetch_array($favorites))
                {
                        $this->roles['favorite']["$fav[userid]"] = $fav['userid'];
                }
-               
+
                $voters = $this->registry->db->query_first("SELECT userids FROM " . TABLE_PREFIX . "vote WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT));
                $this->roles['voter'] = preg_split('#,#', $voters['userids'], 0, PREG_SPLIT_NO_EMPTY);
-               
+
                $commenters = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "comment WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT));
                while ($comment = $this->registry->db->fetch_array($commenters))
                {
                        $this->roles['commenter']["$comment[userid]"] = $comment['userid'];
                }
-               
+
                $masterids = array_merge($this->roles['-notapplicable-'], $this->roles['reporter'], $this->roles['assignee'], $this->roles['favorite'], $this->roles['voter'], $this->roles['commenter']);
                $masterids = $this->registry->funct->array_strip_empty(array_unique($masterids));
-               
+
                if (is_array($masterids) AND sizeof($masterids) > 0)
                {
                        $userinfo = $this->registry->db->query("
@@ -197,7 +197,7 @@ class NotificationCenter
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends the appropriate emails for changes to bugs. This function
@@ -213,7 +213,7 @@ class NotificationCenter
                {
                        return;
                }
-               
+
                // fields with custom mask information
                if ($this->original['assignedto'] != $this->modified['assignedto'])
                {
@@ -238,7 +238,7 @@ class NotificationCenter
                {
                        $this->notice_duplicates_change($this->original['duplicates'], $this->modified['duplicates']);
                }
-               
+
                // other standard fields that don't have custom masks
                if ($this->original['severity'] != $this->modified['severity'])
                {
@@ -252,7 +252,7 @@ class NotificationCenter
                {
                        $this->notice_pcv_change(array($this->original['product'], $this->original['component'], $this->original['version']), array($this->modified['product'], $this->modified['component'], $this->modified['version']));
                }
-               
+
                $dofields = array(
                        'summary'               => -1,
                        'dependency'    => -1,
@@ -266,7 +266,7 @@ class NotificationCenter
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends an email to the specified user ID that they are no longer the
@@ -285,7 +285,7 @@ class NotificationCenter
                        $this->notices["$userid"][] = $part;
                }
        }
-       
+
        // ###################################################################
        /**
        * Informs the user that they have been made the assignee of the bug.
@@ -303,7 +303,7 @@ class NotificationCenter
                        $this->notices["$userid"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends a message to inform users that the status has changed.
@@ -322,7 +322,7 @@ class NotificationCenter
                        $this->notices["$user[userid]"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends an email to inform users that the resolution has changed.
@@ -341,7 +341,7 @@ class NotificationCenter
                        $this->notices["$user[userid]"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Informs users that the duplicates list has changed.
@@ -360,7 +360,7 @@ class NotificationCenter
                        $this->notices["$user[userid]"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends an email to inform users that the severity has changed.
@@ -379,7 +379,7 @@ class NotificationCenter
                        $this->notices["$user[userid]"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Informs users that the priority changed.
@@ -398,7 +398,7 @@ class NotificationCenter
                        $this->notices["$user[userid]"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends an email telling users that the product, component, or version
@@ -413,17 +413,17 @@ class NotificationCenter
        function notice_pcv_change($old, $new)
        {
                $userlist = $this->fetch_users_with_on_bit('otherfield');
-               
+
                $old = $this->registry->datastore['product']["$old[0]"]['title'] . '/' . ($old[1] ? $this->registry->datastore['product']["$old[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$old[2]"]['version'];
                $new =  $this->registry->datastore['product']["$new[0]"]['title'] . '/' . ($new[1] ? $this->registry->datastore['product']["$new[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$new[2]"]['version'];
-               
+
                foreach ($userlist AS $userid => $user)
                {
                        eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_product.part', $this->_localeFromUserId($userid))) . '";');
                        $this->notices["$user[userid]"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends the appropriate users information about a new comment being
@@ -440,12 +440,12 @@ class NotificationCenter
                {
                        $user = construct_user_display($this->registry->userinfo, false);
                        $date = $this->registry->modules['date']->format($this->registry->options['dateformat'], $comment['dateline']);
-                       
+
                        eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_comment.part', $this->_localeFromUserId($userid))) . '";');
                        $this->notices["$userid"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * A notice for an individual field changing.
@@ -465,7 +465,7 @@ class NotificationCenter
                        $this->notices["$user[userid]"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends appropriate users a notice when a new attachment has been
@@ -484,12 +484,12 @@ class NotificationCenter
                {
                        $user = construct_user_display($this->registry->userinfo, false);
                        $obsoletes = implode(', ', (array)$obsolete);
-                       
+
                        eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_attachment.part', $this->_localeFromUserId($userid))) . '";');
                        $this->notices["$userid"][] = $email;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sends a new bug notification notice to all those who have the option
@@ -525,7 +525,7 @@ class NotificationCenter
                        $this->users["$userInfo[userid]"]['options']["$userInfo[relation]"] = $userInfo['mask'];
                }
        }
-       
+
        // ###################################################################
        /**
        * Generates an array of users who have a given email notification flag
@@ -540,7 +540,7 @@ class NotificationCenter
        function fetch_users_with_on_bit($bitname)
        {
                $idlist = array();
-               
+
                foreach ($this->users AS $user)
                {
                        foreach ($this->registry->emailoptions['relations'] AS $name => $bit)
@@ -551,18 +551,18 @@ class NotificationCenter
                                }
                        }
                }
-               
+
                $masters = array_unique($idlist);
-               
+
                $return = array();
                foreach ($masters AS $userid)
                {
                        $return["$userid"] =& $this->users["$userid"];
                }
-               
+
                return $return;
        }
-       
+
        // ###################################################################
        /**
        * Compiles and sends the actual emails to users.
@@ -580,21 +580,21 @@ class NotificationCenter
                                $this->registry->debug("skipping user $userid because they're the one doing the thing");
                                continue;
                        }
-                       
+
                        // we wouldn't want people who favorite bugs getting hidden notices
                        if (!check_bug_permissions($bug, $this->users["$userid"]))
                        {
                                $this->registry->debug("skipping user $userid ({$this->users[$userid]['email']}) because of permissions");
                                continue;
                        }
-                       
+
                        $parts = implode("\n\n", $noticelist);
-                       
+
                        eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('bugnotification.xml', $this->_localeFromUserId($userid))) . '";');
                        $email = $this->registry->xml->parse($email, true);
                        $this->registry->mail->setSubject($email['email']['subject']['value']);
                        $this->registry->mail->setBodyText($email['email']['bodyText']['value']);
-                       
+
                        if (!empty($this->users["$userid"]['email']))
                        {
                                $this->registry->mail->send($this->users["$userid"]['email'], $this->users["$userid"]['displayname']);
@@ -605,7 +605,7 @@ class NotificationCenter
                        }
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns the locale name from a given user ID
index d0de4c47f81d71a14f9aa8515312c04d91f417a2..af05e61594e3e8301c80f687c656dca0412c4dc7 100644 (file)
@@ -28,7 +28,7 @@
 * @copyright   Copyright (c)2002 - 2007, Blue Static
 * @version             $Revision$
 * @package             Bugdar
-* 
+*
 */
 class ListSorter
 {
@@ -38,34 +38,34 @@ class ListSorter
        * @access       private
        */
        var $registry;
-       
+
        /**
        * Page name
        * @var  string
        * @access       public
        */
        var $page = '';
-       
+
        /**
        * Current sort key
        * @var  string
        * @access       private
        */
        var $sortkey = '';
-       
+
        /**
        * Current sort direction
        * @var  string
        * @access       private
        */
        var $direction = '';
-       
+
        /**
        * Column array for table heads
        * @var array
        */
        var $columns;
-       
+
        // ###################################################################
        /**
        * Constructor: set the page name
@@ -81,7 +81,7 @@ class ListSorter
                $this->page = $page;
                $this->process_incoming();
        }
-       
+
        // ###################################################################
        /**
        * Processes the incoming variables and then sets all the sort order
@@ -96,14 +96,14 @@ class ListSorter
                {
                        $this->sortkey = (isset($this->registry->userinfo['defaultsortkey']) ? $this->registry->userinfo['defaultsortkey'] : $this->registry->options['defaultsortkey']);
                }
-               
+
                $this->direction = $this->registry->in['as'];
                if (!in_array($this->direction, array('asc', 'desc')))
                {
                        $this->direction = (isset($this->registry->userinfo['defaultsortas']) ? $this->registry->userinfo['defaultsortas'] : $this->registry->options['defaultsortas']);
                }
        }
-       
+
        // ###################################################################
        /**
        * Fetch a SQL query to gather bugs with the sort filters applied
@@ -122,7 +122,7 @@ class ListSorter
                                        AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $this->registry->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")" .
                                        (($this->registry->options['hidestatuses'] OR isset($this->registry->userinfo['hidestatuses'])) ? "
                                        AND bug.status NOT IN (" . ($this->registry->userinfo['hidestatuses'] != '' ? $this->registry->userinfo['hidestatuses'] : $this->registry->options['hidestatuses']) . ")" : "");
-                                               
+
                // remap the sort keys to be actual SQL fields
                $querykeys = array(
                        'bugid'         => 'bugid',
@@ -131,7 +131,7 @@ class ListSorter
                        'lastpost'      => (can_perform('canviewhidden') ? "lastposttime" : "hiddenlastposttime"),
                        'assignedto'=> 'assignedto'
                );
-               
+
                switch ($this->sortkey)
                {
                        case 'bugid':
@@ -143,7 +143,7 @@ class ListSorter
                                        SELECT bug.*, vote.votefor, vote.voteagainst FROM " . TABLE_PREFIX . "bug AS bug
                                        LEFT JOIN " . TABLE_PREFIX . "vote AS vote
                                                ON (bug.bugid = vote.bugid)
-                                       WHERE $basewhere" . 
+                                       WHERE $basewhere" .
                                                (is_array($where) ? "
                                                AND " . implode("\nAND ", $where) : "") . "
                                        ORDER BY " . $querykeys[ $this->sortkey ] . " " . strtoupper($this->direction) . ($this->sortkey != 'lastpost' ? ", " . $querykeys['lastpost'] . " " . strtoupper($this->direction) : "") . ($limit ? "
@@ -163,7 +163,7 @@ class ListSorter
                                                ON (bug.$key = $key.{$key}id)
                                        LEFT JOIN " . TABLE_PREFIX . "vote AS vote
                                                ON (bug.bugid = vote.bugid)
-                                       WHERE $basewhere" . 
+                                       WHERE $basewhere" .
                                                (is_array($where) ? "
                                                AND " . implode("\nAND ", $where) : "") . "
                                        ORDER BY $key.displayorder " . strtoupper($this->direction) . ", bug.$querykeys[lastpost] " . strtoupper($this->direction) . ($limit ? "
@@ -174,17 +174,17 @@ class ListSorter
                                        SELECT bug.*, vote.votefor, vote.voteagainst FROM " . TABLE_PREFIX . "bug AS bug
                                        LEFT JOIN " . TABLE_PREFIX . "vote AS vote
                                                ON (bug.bugid = vote.bugid)
-                                       WHERE $basewhere" . 
+                                       WHERE $basewhere" .
                                                (is_array($where) ? "
                                                AND " . implode("\nAND ", $where) : "") . "
                                        ORDER BY vote.votefor " . strtoupper($this->direction) . ", vote.voteagainst " . strtoupper($this->fetch_opposite_sort_direction()) . ", bug.$querykeys[lastpost] " . strtoupper($this->direction) . ($limit ? "
                                        LIMIT $limit" : "");
                                break;
                }
-               
+
                return $query;
        }
-       
+
        // ###################################################################
        /**
        * Returns the display text for a given sort order key
@@ -198,7 +198,7 @@ class ListSorter
        function fetch_by_text($key)
        {
                global $lang;
-               
+
                $keys = array(
                        'lastpost'              => T('Last Post Time'),
                        'bugid'                 => T('Bug ID'),
@@ -214,7 +214,7 @@ class ListSorter
                        'votes'                 => T('Votes'),
                        'assignedto'    => T('Assigned To')
                );
-               
+
                if ($key === false)
                {
                        return $keys;
@@ -224,7 +224,7 @@ class ListSorter
                        return $keys["$key"];
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns the display text for a given sort order direction
@@ -238,12 +238,12 @@ class ListSorter
        function fetch_as_text($key)
        {
                global $lang;
-               
+
                $keys = array(
                        'desc'  => T('Descending'),
                        'asc'   => T('Ascending')
                );
-               
+
                if ($key === false)
                {
                        return $keys;
@@ -253,7 +253,7 @@ class ListSorter
                        return $keys["$key"];
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns a multi-dimensional array with sort by keys indexing arrays
@@ -274,10 +274,10 @@ class ListSorter
                {
                        $return["$key"] = array('image' => ($this->sortkey == $key ? $this->fetch_sort_image() : ''), 'href' => $this->fetch_sort_link($key, $params, true));
                }
-               
+
                return $return;
        }
-       
+
        // ###################################################################
        /**
        * Returns the entire <img> tag for the sort arrow
@@ -290,7 +290,7 @@ class ListSorter
        {
                return '<img src="templates/images/arrow_' . $this->fetch_sort_direction() . '.gif" alt="" style="vertical-align: top; border: none" />';
        }
-       
+
        // ###################################################################
        /**
        * Returns the href value for an <a> tag by generating all the necessary
@@ -310,10 +310,10 @@ class ListSorter
                {
                        $params .= '&amp;';
                }
-               
+
                return $this->page . '.php?' . $params . 'by=' . $key . '&amp;as=' . (($this->sortkey == $key AND $highlight) ? $this->fetch_opposite_sort_direction() . '" class="select' : $this->fetch_sort_direction());
        }
-       
+
        // ###################################################################
        /**
        * Returns the OPPOSITE direction to sort when you click on a link
@@ -323,7 +323,7 @@ class ListSorter
        * @return       string  Either asc or desc
        */
        function fetch_opposite_sort_direction()
-       {       
+       {
                if ($this->direction == 'asc')
                {
                        return 'desc';
@@ -333,7 +333,7 @@ class ListSorter
                        return 'asc';
                }
        }
-       
+
        // ###################################################################
        /**
        * Returns the current sorted direction for the image path
@@ -343,10 +343,10 @@ class ListSorter
        * @return       string  Either asc or desc
        */
        function fetch_sort_direction()
-       {       
+       {
                return $this->direction;
        }
-       
+
        // ###################################################################
        /**
        * Returns the HTML code for bug listing table column headers
@@ -359,7 +359,7 @@ class ListSorter
        function constructColumnHeaders($sortable, $params = null)
        {
                $this->_processColumns();
-               
+
                $output = '';
                foreach ($this->columns AS $columns)
                {
@@ -372,10 +372,10 @@ class ListSorter
                        $name = implode(' / ', $build);
                        eval('$output .= "' . $this->registry->template->fetch('list_head') . '";');
                }
-               
+
                return $output;
        }
-       
+
        // ###################################################################
        /**
        * Returns the HTML code for a row of data for the bug listing
@@ -388,9 +388,9 @@ class ListSorter
        function constructRow($bug, $params = null)
        {
                global $bugsys;
-               
+
                $this->_processColumns();
-                               
+
                foreach ($this->columns AS $columns)
                {
                        if (sizeof($columns) > 1)
@@ -408,11 +408,11 @@ class ListSorter
                        }
                        $fields .= "\n\t<td>$data</td>";
                }
-               
+
                eval('$output = "' . $this->registry->template->fetch('trackerhome_bits') . '";');
                return $output;
        }
-       
+
        // ###################################################################
        /**
        * Handler for special-case column data
@@ -442,7 +442,7 @@ class ListSorter
                                return $open . $bug["$column"] . $close;
                }
        }
-       
+
        // ###################################################################
        /**
        * Sets up $this->columns so that the data can be processed more
@@ -454,9 +454,9 @@ class ListSorter
                {
                        return;
                }
-               
+
                $array = (($this->registry->userinfo['userid'] AND is_array($this->registry->userinfo['columnoptions'])) ? $this->registry->userinfo['columnoptions'] : $this->registry->options['columnoptions']);
-               
+
                foreach ($array AS $column => $position)
                {
                        if ($position > 0)
@@ -464,7 +464,7 @@ class ListSorter
                                $this->columns["$position"][] = $column;
                        }
                }
-               
+
                ksort($this->columns);
        }
 }
index b26537767634222bf5b1b69fb51c269ccacbc61a..10fd598927484160c05de4a3a66b48f113683b7d 100644 (file)
 function construct_option_select($name, $array, $selected = 0, $valuekey = '', $labelkey = '', $includenil = false, $multiple = false)
 {
        global $bugsys;
-       
+
        if ($multiple)
        {
                $selected = explode(',', $selected);
        }
-       
+
        // if we're not working on a boolean false, we use it for the value (allows -1 and 0)
        if ($includenil !== false)
        {
@@ -64,13 +64,13 @@ function construct_option_select($name, $array, $selected = 0, $valuekey = '', $
 function construct_user_display($userinfo, $html = true)
 {
        global $bugsys;
-       
+
        if (!$userinfo['userid'])
        {
                $userinfo['displayname'] = T('Guest');
                $userinfo['showemail'] = false;
        }
-       
+
        if ($html)
        {
                eval('$username = "' . $bugsys->template->fetch('username_display') . '";');
@@ -86,7 +86,7 @@ function construct_user_display($userinfo, $html = true)
                        $username = $userinfo['displayname'];
                }
        }
-       
+
        return $username;
 }
 
@@ -95,7 +95,7 @@ function construct_user_display($userinfo, $html = true)
 function can_perform($bitmask, $productid = 0, $userinfo = null)
 {
        global $bugsys;
-       
+
        // masks that aren't product-specific
        static $inspecific = array(
                'cansearch',
@@ -108,28 +108,28 @@ function can_perform($bitmask, $productid = 0, $userinfo = null)
                'canadmingroups',
                'canadmintools'
        );
-       
+
        if ($userinfo == null)
        {
                $userinfo =& $bugsys->userinfo;
        }
-       
+
        $permissions =& bugdar::$datastore['permission'];
-       
+
        if (!isset($bugsys->permissions["$bitmask"]))
        {
                trigger_error('Invalid bitmask "' . $bitmask . '" specified for can_perform() [includes/functions.php]', E_USER_WARNING);
        }
-       
+
        if (!$userinfo['permissions'])
        {
                $userinfo['permissions'] = FetchUserPermissions($userinfo);
        }
-       
+
        if ($productid AND !in_array($bitmask, $inspecific))
        {
                $verdict = (isset($permissions["$userinfo[usergroupid]"]["$productid"]) ? ($permissions["$userinfo[usergroupid]"]["$productid"] & $bugsys->permissions["$bitmask"]) : ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]));
-               
+
                foreach ($userinfo['groupids'] AS $group)
                {
                        if (isset($permissions["$group"]["$productid"]))
@@ -140,7 +140,7 @@ function can_perform($bitmask, $productid = 0, $userinfo = null)
                $bugsys->debug("verdict* on can_perform($bitmask, $productid, $userinfo[userid]) = $verdict");
                return $verdict;
        }
-       
+
        $bugsys->debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]));
        return ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]);
 }
@@ -164,14 +164,14 @@ function can_perform($bitmask, $productid = 0, $userinfo = null)
 function construct_datastore_select($datastore, $labelname, $valuename, $selectedvalue = 0, $includeblank = false, $adminmode = false)
 {
        global $bugsys;
-       
+
        if ($adminmode)
        {
                global $admin;
        }
-       
+
        $select = '';
-       
+
        if ($includeblank === true OR $includeblank !== false)
        {
                $newval = ($inclueblank === true ? '' : $includeblank);
@@ -187,13 +187,13 @@ function construct_datastore_select($datastore, $labelname, $valuename, $selecte
                        eval('$select .= "' . $bugsys->template->fetch('selectoption') . '";');
                }
        }
-       
+
        foreach (bugdar::$datastore["$datastore"] AS $item)
        {
                $label = $item["$labelname"];
                $value = $item["$valuename"];
                $selected = (($value == $selectedvalue OR (is_array($selectedvalue) AND in_array($value, $selectedvalue))) ? true : false);
-               
+
                if ($adminmode)
                {
                        $admin->list_item($label, $value, $selected);
@@ -203,7 +203,7 @@ function construct_datastore_select($datastore, $labelname, $valuename, $selecte
                        eval('$select .= "' . $bugsys->template->fetch('selectoption') . '";');
                }
        }
-       
+
        if (!$adminmode)
        {
                return $select;
@@ -215,7 +215,7 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
 {
        global $bugsys;
        static $fields;
-       
+
        if (!is_array($fields))
        {
                $fields = array();
@@ -233,16 +233,16 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
                        $fields["$field[fieldid]"] = $field;
                }
        }
-       
+
        $fieldbits = array();
-       
+
        foreach ($fields AS $field)
        {
                if ($nodefault)
                {
                        $field['defaultvalue'] = '';
                }
-               
+
                if (!is_null($bug["custom$field[fieldid]"]))
                {
                        $bugsys->debug("not null: $field[fieldid]");
@@ -252,12 +252,12 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
                {
                        $value = $field['defaultvalue'];
                }
-               
+
                if ($ignore21mask AND $field['mask'] != 0)
                {
                        $field['mask'] = 2;
                }
-               
+
                if ($field['mask'] == 2)
                {
                        switch ($field['type'])
@@ -265,18 +265,18 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
                                case 'input_text':
                                        eval('$tempfield = "' . $bugsys->template->fetch('bugfield_input_text') . '";');
                                break;
-                               
+
                                case 'input_checkbox':
                                        $selected = ($value ? ' checked="checked"' : '');
                                        eval('$tempfield = "' . $bugsys->template->fetch('bugfield_input_checkbox') . '";');
                                break;
-                               
+
                                case 'select_single':
                                        $selects = unserialize($field['selects']);
                                        $value = trim($value);
-                                       
+
                                        $options = '';
-                                       
+
                                        // this overrides $field['usedefault'] because required fields will no longer have
                                        // blank values as options
                                        // TODO document above comment in the ACP
@@ -294,7 +294,7 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
                                                }
                                                eval('$options .= "' . $bugsys->template->fetch('bugfield_select_single_option') . '";');
                                        }
-                                       
+
                                        foreach ($selects AS $id => $select)
                                        {
                                                $selected = '';
@@ -340,7 +340,7 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
                        {
                                $value = $bug["custom$field[fieldid]"];
                        }
-                                       
+
                        if ($field['type'] == 'input_checkbox')
                        {
                                $value = ($value ? 'True' : 'False');
@@ -350,7 +350,7 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
                }
                $fieldbits[] = $tempfield;
        }
-       
+
        return $fieldbits;
 }
 
@@ -370,12 +370,12 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau
 function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = false)
 {
        global $bugsys;
-       
+
        if (!$inputdata)
        {
                $inputdata =& $bugsys->in;
        }
-       
+
        $fields = $bugsys->db->query("
                SELECT bugfield.*, MAX(permission.mask) AS mask
                FROM " . TABLE_PREFIX . "bugfield AS bugfield
@@ -388,7 +388,7 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode =
        while ($field = $bugsys->db->fetch_array($fields))
        {
                $fieldname = "custom$field[fieldid]";
-               
+
                if ($field['type'] == 'input_checkbox')
                {
                        if ($searchMode AND intval($inputdata["$fieldname"]) == 0)
@@ -403,19 +403,19 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode =
                        $temp = unserialize($field['selects']);
                        $inputdata[$fieldname] = $temp[intval($inputdata["$fieldname"])] . ''; // make it a string so isset() doesn't catch
                }
-               
+
                // field data wasn't passed, so skip it
                if (!isset($inputdata["$fieldname"]))
                {
                        continue;
                }
-                               
+
                if ($field['required'] AND empty($inputdata["$fieldname"]) AND !$searchMode)
                {
                        $errorlist[] = sprintf(T('The field "%1$s" is a required.'), $field['name']);
                        continue;
                }
-               
+
                if (!empty($field['regexmatch']))
                {
                        if (!preg_match('#' . str_replace('#', '\#', $field['regexmatch']) . '#si', $inputdata["$fieldname"]))
@@ -424,7 +424,7 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode =
                                continue;
                        }
                }
-               
+
                if (isset($inputdata["$fieldname"]))
                {
                        if ($field['type'] == 'input_text')
@@ -445,12 +445,12 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode =
                                        }
                                        continue;
                                }
-                               
+
                                $bugapi->set($fieldname, trim($inputdata["$fieldname"]));
                        }
                }
        }
-       
+
        if ($errorlist)
        {
                if ($errorbox)
@@ -471,19 +471,19 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode =
 function fetch_on_bits($mask, $userinfo = null)
 {
        global $bugsys;
-       
+
        if ($userinfo == null)
        {
                $userinfo =& $bugsys->userinfo;
        }
-       
+
        $onbits = array();
-       
+
        $usergroupid = $userinfo['usergroupid'];
        FetchUserPermissions($userinfo); // get the groups
        $groups = $userinfo['groupids'];
        $groups[] = $usergroupid;
-       
+
        // product-inspecific work
        if (is_array(bugdar::$datastore['product']))
        {
@@ -499,10 +499,10 @@ function fetch_on_bits($mask, $userinfo = null)
                        }
                }
        }
-       
+
        // bits set explicitly by products
        $explicit = array();
-       
+
        // product specific work
        foreach ($groups AS $groupid)
        {
@@ -527,13 +527,13 @@ function fetch_on_bits($mask, $userinfo = null)
                        }
                }
        }
-       
+
        // SQL queries would become very unhappy if we didn't do this
        if (sizeof($onbits) < 1)
        {
                $onbits = array(0);
        }
-       
+
        return implode(',', $onbits);
 }
 
@@ -546,7 +546,7 @@ function isso_pre_parse_hook($template)
 }
 
 // ###################### Start fetch_help_link ######################
-// returns a prepared link to insert into templates that opens up a 
+// returns a prepared link to insert into templates that opens up a
 // help popup in the user-end
 function fetch_help_link($topic)
 {
@@ -574,7 +574,7 @@ function fetch_help_link($topic)
 function fetch_guest_user()
 {
        global $bugsys;
-               
+
        return array(
                'usergroupid' => 1,
                'groupids' => array(),
@@ -608,18 +608,18 @@ function check_bug_permissions($bug, $userinfo = null)
        {
                $userinfo = $bugsys->userinfo;
        }
-       
+
        $bugsys->debug("checking permissions for $userinfo[userid] on bug $bug[bugid]");
-       
+
        $bugsys->debug('*** START VERBOSE CHECK ***');
-       
+
        $bugsys->debug('* !can_perform(canviewbugs, $bug[product], $userinfo) = ' . (int)(!can_perform('canviewbugs', $bug['product'], $userinfo)));
        $bugsys->debug('* $bug[hidden] = ' . (int)$bug['hidden']);
        $bugsys->debug('* $userinfo[userid] (' . $userinfo['userid'] . ') == $bug[userid] (' . $bug['userid'] . ') = ' . (int)($userinfo['userid'] == $bug['userid']));
        $bugsys->debug('* can_perform(canviewownhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewownhidden', $bug['product'], $userinfo)));
        $bugsys->debug('* can_perform(canviewhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewhidden', $bug['product'], $userinfo)));
        $bugsys->debug('* !$bug[hidden] = ' . (int)(!$bug['hidden']));
-       
+
        $bugsys->debug('*** END PERMISSIONS CHECK ***');
 
        if (!can_perform('canviewbugs', $bug['product'], $userinfo)) {
@@ -658,9 +658,9 @@ function check_bug_permissions($bug, $userinfo = null)
 function ProcessBugDataForDisplay($bug, $color = '')
 {
        global $bugsys;
-       
+
        $bug['hiddendisplay'] = ($bug['hidden'] AND (can_perform('canviewhidden', $bug['product']) OR (can_perform('canviewownhidden') AND $bug['userid'] == $bugsys->userinfo['userid'])));
-       
+
        $bug['bgcolor'] = ($bugsys->userinfo['showcolors'] ? bugdar::$datastore['status']["$bug[status]"]['color'] : $color);
        $bug['product'] = bugdar::$datastore['product']["$bug[product]"]['title'];
        $bug['version'] = bugdar::$datastore['version']["$bug[version]"]['version'];
@@ -670,12 +670,12 @@ function ProcessBugDataForDisplay($bug, $color = '')
        $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority'];
        $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity'];
        $bug['assignedto'] = ((empty($bug['assignedto']) OR !isset(bugdar::$datastore['assignto']["$bug[assignedto]"])) ? '' : construct_user_display(bugdar::$datastore['assignto']["$bug[assignedto]"]));
-       
+
        $bug['lastposttime'] = ($bug['hiddendisplay'] ? $bug['hiddenlastposttime'] : $bug['lastposttime']);
        $bug['lastpost'] = ($bug['hiddendisplay'] ? $bug['hiddenlastpostbyname'] : $bug['lastpostbyname']);
-       
+
        $bug['lastposttime'] = $bugsys->datef->format($bugsys->options['dateformat'], $bug['lastposttime']);
-       
+
        return $bug;
 }
 
@@ -689,7 +689,7 @@ function ProcessBugDataForDisplay($bug, $color = '')
 function LoadPaginationFramework()
 {
        global $bugsys;
-       
+
        $bugsys->load('pagination', 'pagination', true);
        $bugsys->pagination->setDefaultPerPage($bugsys->options['defaultpp']);
        $bugsys->pagination->setMaxPerPage($bugsys->options['maxpp']);
@@ -754,19 +754,19 @@ function PageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pagebits
 function FetchUserPermissions(&$user)
 {
        global $bugsys;
-       
+
        $perms = (int)bugdar::$datastore['usergroup']["$user[usergroupid]"]['permissions'];
        if (!is_array($user['groupids']))
        {
                $user['groupids'] = explode(',', $bugsys->userinfo['groupids']);
        }
        $user['groupids'] = $bugsys->funct->array_strip_empty($user['groupids']);
-       
+
        foreach ($user['groupids'] AS $group)
        {
                $perms |= (int)bugdar::$datastore['usergroup']["$group"]['permissions'];
        }
-       
+
        return $perms;
 }
 
index 74ca7b3c8ef3c72ad1481a23c9d6762f172ed6fc..e5e4536c1061f085e34744ec4d09157a7b7ddcc1 100644 (file)
 function build_languages()
 {
        global $bugsys;
-       
+
        $languages = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "language");
        while ($language = $bugsys->db->fetch_array($languages))
        {
                $tempstore["$language[languageid]"] = $language;
        }
-       
+
        $bugsys->db->query("
                ### replacing the language cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
@@ -43,19 +43,19 @@ function build_languages()
 function build_settings()
 {
        global $bugsys;
-       
+
        $settings = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "setting");
        while ($setting = $bugsys->db->fetch_array($settings))
        {
                $options["$setting[varname]"] = $setting['value'];
        }
-       
+
        $bugsys->db->query("
                ### replacing the setting cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('setting', '" . $bugsys->escape(serialize($options)) . "')"
        );
-       
+
        bugdar::$datastore['setting'] = $options;
 }
 
@@ -63,19 +63,19 @@ function build_settings()
 function build_usergroups()
 {
        global $bugsys;
-       
+
        $usergroups = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup");
        while ($usergroup = $bugsys->db->fetch_array($usergroups))
        {
                $groups["$usergroup[usergroupid]"] = $usergroup;
        }
-       
+
        $bugsys->db->query("
                ### replacing usergroup cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('usergroup', '" . $bugsys->escape(serialize($groups)) . "')"
        );
-       
+
        bugdar::$datastore['usergroup'] = $groups;
 }
 
@@ -83,19 +83,19 @@ function build_usergroups()
 function build_statuses()
 {
        global $bugsys;
-       
+
        $statuses = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "status ORDER BY displayorder ASC");
        while ($status = $bugsys->db->fetch_array($statuses))
        {
                $tempstore["$status[statusid]"] = $status;
        }
-       
+
        $bugsys->db->query("
                ### replacing status cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('status', '" . $bugsys->escape(serialize($tempstore)) . "')"
        );
-       
+
        bugdar::$datastore['status'] = $tempstore;
 }
 
@@ -103,19 +103,19 @@ function build_statuses()
 function build_severities()
 {
        global $bugsys;
-       
+
        $severities = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder ASC");
        while ($severity = $bugsys->db->fetch_array($severities))
        {
                $tempstore["$severity[severityid]"] = $severity;
        }
-       
+
        $bugsys->db->query("
                ### replacing severity cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('severity', '" . $bugsys->escape(serialize($tempstore)) . "')"
        );
-       
+
        bugdar::$datastore['severity'] = $tempstore;
 }
 
@@ -123,19 +123,19 @@ function build_severities()
 function build_priorities()
 {
        global $bugsys;
-       
+
        $priorities = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "priority ORDER BY displayorder ASC");
        while ($priority = $bugsys->db->fetch_array($priorities))
        {
                $tempstore["$priority[priorityid]"] = $priority;
        }
-       
+
        $bugsys->db->query("
                ### replacing priority cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('priority', '" . $bugsys->escape(serialize($tempstore)) . "')"
        );
-       
+
        bugdar::$datastore['priority'] = $tempstore;
 }
 
@@ -143,7 +143,7 @@ function build_priorities()
 function build_assignedto()
 {
        global $bugsys;
-       
+
        // determine the groups that are assignable
        $ids = $exprs = array();
        foreach (bugdar::$datastore['usergroup'] AS $id => $group)
@@ -154,7 +154,7 @@ function build_assignedto()
                        $exprs[] = "FIND_IN_SET($id, groupids)";
                }
        }
-       
+
        $ids = implode(',', $ids);
        $exprs = implode(' OR ', $exprs);
        $users = $bugsys->db->query("
@@ -166,13 +166,13 @@ function build_assignedto()
        {
                $devs["$user[userid]"] = $user;
        }
-       
+
        $bugsys->db->query("
                ### replacing developer / assign to cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('assignto', '" . $bugsys->escape(serialize($devs)) . "')"
        );
-       
+
        bugdar::$datastore['assignto'] = $devs;
 }
 
@@ -180,19 +180,19 @@ function build_assignedto()
 function build_resolutions()
 {
        global $bugsys;
-       
+
        $resolutions = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder ASC");
        while ($resolution = $bugsys->db->fetch_array($resolutions))
        {
                $tempstore["$resolution[resolutionid]"] = $resolution;
        }
-       
+
        $bugsys->db->query("
                ### replacing resolution cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('resolution', '" . $bugsys->escape(serialize($tempstore)) . "')"
        );
-       
+
        bugdar::$datastore['resolution'] = $tempstore;
 }
 
@@ -200,19 +200,19 @@ function build_resolutions()
 function build_versions()
 {
        global $bugsys;
-       
+
        $versions = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "version ORDER BY displayorder ASC");
        while ($version = $bugsys->db->fetch_array($versions))
        {
                $tempstore["$version[versionid]"] = $version;
        }
-       
+
        $bugsys->db->query("
                ### replacing version cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('version', '" . $bugsys->escape(serialize($tempstore)) . "')"
        );
-       
+
        bugdar::$datastore['version'] = $tempstore;
 }
 
@@ -220,7 +220,7 @@ function build_versions()
 function build_products()
 {
        global $bugsys;
-       
+
        $products = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "product ORDER BY displayorder ASC");
        while ($product = $bugsys->db->fetch_array($products))
        {
@@ -233,7 +233,7 @@ function build_products()
                        $tempstore['product']["$product[productid]"] = $product;
                }
        }
-       
+
        $bugsys->db->query("
                ### replacing product / component cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
@@ -241,7 +241,7 @@ function build_products()
                        ('product', '" . $bugsys->escape(serialize($tempstore['product'])) . "'),
                        ('component', '" . $bugsys->escape(serialize($tempstore['component'])) . "')"
        );
-       
+
        bugdar::$datastore['product'] = $tempstore['product'];
        bugdar::$datastore['component'] = $tempstore['component'];
 }
@@ -250,19 +250,19 @@ function build_products()
 function build_permissions()
 {
        global $bugsys;
-       
+
        $permissions = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "permission ORDER BY usergroupid, productid");
        while ($permission = $bugsys->db->fetch_array($permissions))
        {
                $tempstore["$permission[usergroupid]"]["$permission[productid]"] = $permission['mask'];
        }
-       
+
        $bugsys->db->query("
                ### replacing permissions cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('permission', '" . $bugsys->escape(serialize($tempstore)) . "')"
        );
-       
+
        bugdar::$datastore['permission'] = $tempstore;
 }
 
@@ -270,19 +270,19 @@ function build_permissions()
 function build_automations()
 {
        global $bugsys;
-       
+
        $automations = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "automation ORDER BY name ASC");
        while ($automation = $bugsys->db->fetch_array($automations))
        {
                $actions["$automation[actionid]"] = $automation;
        }
-       
+
        $bugsys->db->query("
                ### replacing automation cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('automation', '" . $bugsys->escape(serialize($actions)) . "')"
        );
-       
+
        bugdar::$datastore['automation'] = $actions;
 }
 
@@ -290,27 +290,27 @@ function build_automations()
 function build_user_help()
 {
        global $bugsys;
-       
+
        // custom field descriptions
        $descriptions = $bugsys->db->query("SELECT fieldid, name, description FROM " . TABLE_PREFIX . "bugfield");
        while ($field = $bugsys->db->fetch_array($descriptions))
        {
                $help["field$field[fieldid]"] = array('title' => $field['name'], 'body' => $field['description']);
        }
-       
+
        // standard help texts
        $texts = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "fieldhelp");
        while ($field = $bugsys->db->fetch_array($texts))
        {
                $help["$field[keystring]"] = $field;
        }
-       
+
        $bugsys->db->query("
                ### replacing user help cache ###
                REPLACE INTO " . TABLE_PREFIX . "datastore (title, data)
                VALUES ('help', '" . $bugsys->escape(serialize($help)) . "')"
        );
-       
+
        bugdar::$datastore['help'] = $help;
 }
 
index 3779ea4e8ad2955c849f7cbe5bd033fb23d5306f..ac263ad76d73ad669438f2e486c1c61701e95e24 100644 (file)
@@ -35,9 +35,9 @@
 function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsolete = true)
 {
        global $bugsys;
-       
+
        $output = '';
-       
+
        // index all of the components by parent and ID
        $components = array();
        if (is_array(bugdar::$datastore['component']))
@@ -47,7 +47,7 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole
                        $components["$prod[parentid]"]["$id"] = $prod;
                }
        }
-       
+
        // these are products
        foreach (bugdar::$datastore['product'] AS $productid => $product)
        {
@@ -55,12 +55,12 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole
                {
                        continue;
                }
-               
+
                if ($versions = ConstructVersionSelect($productid, $select, $obsolete))
                {
                        $output .= ConstructOptionGroup($product['title'], $versions);
                }
-               
+
                // these are components
                if ($components["$productid"])
                {
@@ -70,7 +70,7 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole
                        }
                }
        }
-       
+
        return $output;
 }
 
@@ -89,19 +89,19 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole
 function ConstructVersionSelect($productid, $select, $obsolete)
 {
        global $bugsys;
-       
+
        $product = bugdar::$datastore['product']["$productid"];
        $component = null;
-       
+
        $build = '';
-       
+
        // this is a component
        if ($product == null)
        {
                $component = bugdar::$datastore['component']["$productid"];
                $product = bugdar::$datastore['product']["$component[parentid]"];
        }
-       
+
        foreach (bugdar::$datastore['version'] AS $versionid => $version)
        {
                if ((!$version['productid'] OR $version['productid'] == $component['productid'] OR $version['productid'] == $product['productid']) AND (!$version['obsolete'] OR ($version['obsolete'] AND $obsolete)))
@@ -112,7 +112,7 @@ function ConstructVersionSelect($productid, $select, $obsolete)
                        eval('$build .= "' . $bugsys->template->fetch('selectoption') . '";');
                }
        }
-       
+
        return $build;
 }
 
index e5a17c247c414c748d631d98e2ba8227f6974f7e..c45f80dab27053bd7456f8c5e0e5bd355dee508c 100644 (file)
@@ -29,13 +29,13 @@ define('L_INVALID_ID', T('That is an invalid ID.'));
 function fetch_user_language()
 {
        global $bugsys;
-       
+
        if ($bugsys->userinfo['userid'])
        {
                $languageid = $bugsys->userinfo['languageid'];
                $language = bugdar::$datastore['language']["$languageid"];
        }
-       
+
        if (!$languageid AND is_array(bugdar::$datastore['language']))
        {
                foreach (bugdar::$datastore['language'] AS $language)
@@ -48,12 +48,12 @@ function fetch_user_language()
                        }
                }
        }
-       
+
        $lang['id'] = $language['languageid'];
        $lang['charset'] = $language['charset'];
        $lang['direction'] = $language['direction'];
        $lang['langcode'] = $language['langcode'];
-       
+
        return $lang;
 }
 
@@ -69,7 +69,7 @@ function T($str)
 {
        global $bugsys;
        static $mo;
-       
+
        if ($mo === null)
        {
                require_once './includes/class_mo.php';
index f882ca073c5820e762048aca91961eed272fd335..a25289c43f46d46e20a615562a81d9e3ada2f03e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -63,7 +63,7 @@ $bugs_fetch = $db->query($sort->fetch_sql_query(null, $pagination->fetchLimit($p
 
 while ($bug = $db->fetch_array($bugs_fetch))
 {
-       $funct->exec_swap_bg('altcolor', '');   
+       $funct->exec_swap_bg('altcolor', '');
        $bug = ProcessBugDataForDisplay($bug, $funct->bgcolour);
        $bugs .= $sort->constructRow($bug);
 }
index a694d197768ad945a1158b56b264d682b90ebabd..d487f53b98ad58b777c7f2b9595e6ce9f0caa7ee 100644 (file)
@@ -44,7 +44,7 @@ $fulltext = array();
 function PrintContinue($step)
 {
        global $admin;
-       
+
        $admin->form_start('convert_database_charset.php', 'convert');
        $admin->form_hidden_field('step', $step);
        echo "\n<input type=\"submit\" value=\"  Continue &#8594;  \" name=\"__submit__\" />";
@@ -58,12 +58,12 @@ $admin->page_start('Convert Database Character Set');
 if ($bugsys->in['step'] == 0)
 {
        $collation = $db->query_first("SHOW VARIABLES LIKE 'collation_database'");
-       
+
        echo '<h1>Convert Database Character Set</h1>';
        echo '<p>Earlier versions of Bugdar did not check or enforce the MySQL database character set or collation. It is recommended that the database be set at <strong>' . TARGET . '</strong>. This script can migrate all of data from your current character set/collation of <strong>' . $collation['Value'] . '</strong>. If you would like to convert your database to utf8, please click the link below.</p>';
-       
+
        echo '<h3>Please back up your database before continuing! While this script is tested and should be safe, it is better to be cautious.</h3>';
-       
+
        PrintContinue(1);
 }
 
@@ -73,11 +73,11 @@ else if ($bugsys->in['step'] == 1)
 {
        echo '<h1>Preserve Existing Data</h1>';
        echo '<p>This converts all the table columns that are stored with a character set to a BLOB type to ensure there are no problems with the target character set.</p>';
-       
+
        $admin->table_start();
        $admin->table_head('Column Preservation');
        $admin->table_column_head(array('Table', 'Column'));
-       
+
        // get rid of indices that are strings
        $db->showerrors = false;
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug DROP INDEX summary");
@@ -85,7 +85,7 @@ else if ($bugsys->in['step'] == 1)
        $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP INDEX languagecode");
        $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP INDEX langcode");
        $db->showerrors = true;
-       
+
        $tables = $db->query("SHOW TABLES");
        while ($table = $db->fetch_array($tables, false))
        {
@@ -105,38 +105,38 @@ else if ($bugsys->in['step'] == 1)
                        }
                }
        }
-       
+
        $admin->table_end();
 
        echo '<h1>Convert Database Character Set</h1>';
        echo '<p>This step changes the database\'s character set.</p>';
-       
+
        require './includes/config.php';
        $db->query("ALTER DATABASE $database COLLATE " . TARGET);
 
        echo '<h1>Convert Table Character Set</h1>';
        echo '<p>This converts each table\'s character set and collation.</p>';
-       
+
        $admin->table_start();
        $admin->table_head('Table Conversion');
        $admin->table_column_head(array('Table Name', 'Result'));
-       
+
        $tables = $db->query("SHOW TABLES");
        while ($table = $db->fetch_array($tables, false))
        {
                $db->query("ALTER TABLE $table[0] COLLATE " . TARGET);
                $admin->row_text($table[0], 'Good');
        }
-       
+
        $admin->table_end();
 
        echo '<h1>Convert Table Columns</h1>';
        echo '<p>This converts all the table columns that are stored with a character set.</p>';
-       
+
        $admin->table_start();
        $admin->table_head('Column Conversion');
        $admin->table_column_head(array('Table', 'Column'));
-       
+
        foreach ($columnConversions AS $table => $columns)
        {
                foreach ($columns AS $column => $type)
@@ -145,18 +145,18 @@ else if ($bugsys->in['step'] == 1)
                        $admin->row_text($table, $column);
                }
        }
-       
+
        foreach ($primaryKeys AS $table => $field)
        {
                $db->query("ALTER TABLE $table ADD PRIMARY KEY ($field)");
        }
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD FULLTEXT(summary)");
        $db->query("ALTER TABLE " . TABLE_PREFIX . "comment ADD FULLTEXT(comment)");
        $db->query("ALTER TABLE " . TABLE_PREFIX . "language ADD UNIQUE(langcode)");
-       
+
        $admin->table_end();
-       
+
        PrintContinue(2);
 }
 
index 9c727ad889880e8e098883882dade68cac1217c2..13a4cc89846b65e2a0ec054809cb211d1989b164 100644 (file)
@@ -70,41 +70,41 @@ if ($bugsys->in['mark'] == 1)
 <strong>MySQL Privileges:</strong>
 <ul>
 <?php
-       
+
        $db->showerrors = false;
-       
+
        $pf = $tests[] = ($db->query("CREATE TABLE install_check (col1 VARCHAR(255) NULL);") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">CREATE TABLE</li>";
-       
+
        $pf = $tests[] = ($db->query("INSERT INTO install_check (col1) VALUES ('example')") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">INSERT</li>";
-       
+
        $pf = $tests[] = ($db->query("UPDATE install_check SET col1 = 'example2'") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">UPDATE</li>";
-       
+
        $pf = $tests[] = ($db->query("SELECT * FROM install_check") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">SELECT</li>";
-       
+
        $pf = $tests[] = ($db->query("DELETE FROM install_check WHERE col1 = 'example2'") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">DELETE</li>";
-       
+
        $pf = $tests[] = ($db->query("ALTER TABLE install_check ADD col3 BOOL") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">ALTER</li>";
-       
+
        $pf = $tests[] = ($db->query("ALTER TABLE install_check ADD INDEX (col1)") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">ALTER ADD INDEX</li>";
-       
+
        $pf = $tests[] = ($db->query("REPLACE INTO install_check (col1) VALUES ('example3')") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">REPLACE</li>";
-       
+
        $pf = $tests[] = ($db->query("OPTIMIZE TABLE install_check") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">OPTIMIZE</li>";
-       
+
        $pf = $tests[] = ($db->query("DROP TABLE install_check") ? 'pass' : 'fail');
        echo "\n\t<li class=\"$pf\">DROP TABLE</li>";
-       
+
        echo "\n</ul>";
-       
+
        $valcount = array_count_values($tests);
        if ($valcount['fail'] > 0)
        {
@@ -123,12 +123,12 @@ if ($bugsys->in['mark'] == 2)
 <p>This step will load the tables into your database so the rest of the installation can proceed forward.</p>
 
 <?php
-       
+
        require './includes/config.php';
        $db->query("ALTER DATABASE $database COLLATE $COLLATION");
-       
+
        require_once('./install/schema.php');
-       
+
        foreach ($schema AS $table => $query)
        {
                $db->query($query);
@@ -146,9 +146,9 @@ if ($bugsys->in['mark'] == 3)
 <p>Default table data for usergroups, statuses, priorities, and other various options are being loaded. This will allow you to use Bugdar with minimal setup.</p>
 
 <?php
-       
+
        require_once('./install/default_data.php');
-       
+
        foreach ($data AS $table => $records)
        {
                foreach ($records AS $record)
@@ -159,13 +159,13 @@ if ($bugsys->in['mark'] == 3)
                                $fields[] = $field;
                                $values[] = addslashes($value);
                        }
-                       
+
                        $db->query("INSERT INTO " . TABLE_PREFIX . "$table (" . implode(',', $fields) . ") VALUES ('" . implode("', '", $values) . "')");
                }
-               
+
                echo 'Populating table ' . $table . '<br />' . "\n";
        }
-       
+
        $db->query("INSERT INTO " . TABLE_PREFIX . "language (title, langcode, charset, direction, userselect) VALUES ('English (US)', 'en_US', 'utf-8', 'ltr', 1)");
        echo 'Inserting default language<br />' . "\n";
 }
@@ -180,14 +180,14 @@ if ($bugsys->in['mark'] == 4)
 <p>Default settings are being loaded into the system.</p>
 
 <?php
-       
+
        require_once('./install/settings.php');
-       
+
        foreach ($settings AS $key => $value)
        {
                $db->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('" . $key . "', '" . $db->escape_string($value) . "')");
        }
-       
+
        echo 'Settings loaded...';
 }
 
@@ -201,39 +201,39 @@ if ($bugsys->in['mark'] == 5)
 
 <p>In order to make Bugdar as efficient as possible, the system caches the portions of data it can. This reduces the load of your server without compromising usability. Currently the caches are being built.</p>
 <?php
-       
+
        require_once('./includes/permissions.php');
-               
+
        build_settings();
        echo "Cached settings<br />\n";
-       
+
        build_usergroups();
        echo "Cached usergroups<br />\n";
-       
+
        build_statuses();
        echo "Cached statuses<br />\n";
-       
+
        build_priorities();
        echo "Cached priorities<br />\n";
-       
+
        build_severities();
        echo "Cached severities<br />\n";
-       
+
        build_assignedto();
        echo "Cached assignable users/developers<br />\n";
-       
+
        build_resolutions();
        echo "Cached resolutions<br />\n";
-       
+
        build_products();
        echo "Cached products<br />\n";
-       
+
        build_versions();
        echo "Cached versions<br />\n";
-       
+
        build_languages();
        echo "Cached languages<br />\n";
-       
+
        build_user_help();
        echo "Cached user help documentation<br />\n";
 }
@@ -284,13 +284,13 @@ if ($bugsys->in['mark'] == 7)
 </form>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '" . $bugsys->input_escape('trackertitle') . "' WHERE varname = 'trackertitle'");
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '" . $bugsys->input_escape('trackerurl') . "' WHERE varname = 'trackerurl'");
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '" . $bugsys->input_escape('webmasteremail') . "' WHERE varname = 'webmasteremail'");
-       
+
        build_settings();
-       
+
        page_end(false);
 }
 
@@ -303,13 +303,13 @@ if ($bugsys->in['mark'] == 8)
 
 <p>Your new user has been added.</p>
 <?php
-       
+
        require_once('./includes/api_user.php');
-       
+
        // we need to do this here because build_assignedto() uses this data and we don't have it loaded in
        // the installer, so we need to do it manually
        build_usergroups();
-       
+
        $user = new UserAPI($bugsys);
        $user->set('email',                     $bugsys->in['email']);
        $user->set('displayname',       $bugsys->in['displayname']);
index 8f01d9551566826dd59d1ec47a29591b1499914a..70f33a17abc39affb13f053a2bc57cf53d3307b5 100644 (file)
@@ -26,36 +26,36 @@ require_once('./global.php');
 if (!isset($bugsys->in['next']))
 {
        $db->showerrors = false;
-       
+
        $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = 'trackerversion'");
        $version = $version['value'];
-       
+
        if ($version == '[#]version[#]')
        {
                header('Location: upgrade16.php');
                exit;
        }
-       
+
        if (!$version)
        {
                die('You have done something to your database and this script cannot determine Bugdar\'s version... or you have no upgrade to perform...');
        }
-       
+
        if ($bugsys->versions["$version"] == -1)
        {
                page_start();
-               
+
                echo "<h1>Bugdar Upgrade System</h1>\n\n";
-               
+
                echo "<p>Your Bugdar installation is up-to-date!</p>\n\n";
-               
+
                page_end(false);
        }
        else
        {
                header("Location: upgrade.php?next=$version");
        }
-       
+
        $db->showerrors = true;
 }
 
@@ -67,7 +67,7 @@ else
        {
                die('Bugdar is up-to-date already');
        }
-       
+
        header("Location: upgrade" . $bugsys->versions[ $bugsys->in['next'] ] . ".php");
 }
 
index 248f0d708b67cfb60e0080cb5a6988e3bb3b6815..cd1e0c149d4b41a65b70f46ed6ce159f4bf34859 100644 (file)
@@ -51,9 +51,9 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.0.1' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
 
 ?>
index b7c4121c751d985c86831078e4cc2744ce4ef097..e3544d55e8350786f9227925ef1a01e3edf44b1b 100644 (file)
@@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.5' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index ef3e63637a297241181cc56ddcef0803ac3cc4c1..fc8d55a43fef85ec785baab0bf0839a17ee515f6 100644 (file)
@@ -49,22 +49,22 @@ if ($bugsys->in['mark'] == 1)
 
 <p>There are a few minor changes made to Bugdar's database schema that need to be propagated.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "comment ADD parselinks BOOL NULL");
        echo "Adding comment.parselinks to add an option to parse links in comments<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD columnoptions TEXT NULL");
        echo "Adding user.columnoptions to allow for custom column sorting<br />\n";
 
        $db->query("ALTER TABLE " . TABLE_PREFIX . "product CHANGE componentmother parentid INT UNSIGNED NULL");
        echo "Renaming product.componentmother to product.parentid<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "version ADD obsolete BOOL NULL");
        echo "Adding version.obsolete so products cannot be filed against certain versions<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD authid VARCHAR(255) NULL");
        echo "Adding user.authid for the Authentication API<br />\n";
-       
+
        echo "... done<br />\n";
 }
 
@@ -77,19 +77,19 @@ if ($bugsys->in['mark'] == 2)
 
 <p>To support saved searches, a few major modifications need to be performed on the search table.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "search DROP PRIMARY KEY");
        echo "Dropping current primary key<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "search ADD searchid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY");
        echo "Adding search.searchid as a new primary key<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "search ADD name VARCHAR(250) NULL");
        echo "Adding search.name to allow naming of searches<br />\n";
-       
+
        $db->query("DELETE FROM " . TABLE_PREFIX . "search");
        echo "Clearing out all the old searches<br />\n";
-       
+
        echo "... done<br />\n";
 }
 
@@ -108,7 +108,7 @@ if ($bugsys->in['mark'] == 3)
        {
                // create the database field
                $db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD custom$field[fieldid] MEDIUMTEXT NULL");
-               
+
                echo "Migrating custom$field[fieldid]";
 
                // update all the data
@@ -120,7 +120,7 @@ if ($bugsys->in['mark'] == 3)
                }
                echo "done<br />\n";
        }
-       
+
        echo ".... all done<br />\n";
 }
 
@@ -136,29 +136,29 @@ if ($bugsys->in['mark'] == 4)
 
        $db->query("DROP TABLE " . TABLE_PREFIX . "bugvaluefill");
        echo "Dropping the old storage system for custom field data<br />";
-       
+
        $db->query("
                CREATE TABLE " . TABLE_PREFIX . "passwordreset
                (
-                       activatorid VARCHAR(250) NOT NULL, 
-                       userid INT NOT NULL, 
+                       activatorid VARCHAR(250) NOT NULL,
+                       userid INT NOT NULL,
                        dateline INT NOT NULL,
                        PRIMARY KEY (activatorid)
                )
        ");
        echo "Creating passwordreset table to create a 'lost password' functionality<br />\n";
-       
+
        $db->query("
                CREATE TABLE " . TABLE_PREFIX . "adminsession
                (
-                       sessionid VARCHAR(250) NOT NULL, 
-                       userid INT UNSIGNED NOT NULL, 
+                       sessionid VARCHAR(250) NOT NULL,
+                       userid INT UNSIGNED NOT NULL,
                        dateline INT UNSIGNED NOT NULL,
                        PRIMARY KEY (sessionid)
                )
        ");
        echo "Creating adminsession table to greatly improve the admin control panel security<br />\n";
-       
+
        $db->query("
                CREATE TABLE " . TABLE_PREFIX . "template
                (
@@ -169,7 +169,7 @@ if ($bugsys->in['mark'] == 4)
                )
        ");
        echo "Creating template table to cache templates in the database to greatly inprove speed<br />\n";
-       
+
        echo "... done<br />\n";
 }
 
@@ -183,15 +183,15 @@ if ($bugsys->in['mark'] == 5)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-                       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0 Beta 1' WHERE varname = 'trackerversion'");
        $db->query("REPLACE INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('authmethod', 'default')");
        $db->query("REPLACE INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('columnoptions', '" . $db->escape_string('a:12:{s:5:"bugid";s:1:"1";s:7:"summary";s:1:"2";s:8:"reporter";s:1:"2";s:7:"product";s:1:"3";s:9:"component";s:1:"0";s:7:"version";s:1:"3";s:6:"status";s:1:"4";s:10:"resolution";s:1:"4";s:8:"priority";s:1:"5";s:8:"severity";s:1:"5";s:8:"lastpost";s:1:"6";s:5:"votes";s:1:"0";}') . "')");
        $db->query("REPLACE INTO " . TABLE_PREFIX . "fieldhelp (keystring, title, body) VALUES ('columnorder', 'Custom Column Ordering', 'You can change the ordering and display of columns on the bug list using these settings. Any column with a position value of &quot;0&quot; will not be displayed in the list. Columns are positioned in the grid with the lowest numbered column starting at the far-left. If columns share a position number, they will be placed in the same column position.')");
-       
+
        build_user_help();
        build_settings();
-       
+
 ?>
 
 ... done.
index a49b329f627581f33800303659ac541e081f15b1..9298ceb62556ce9d24e133c1c76ce3e84bed9649 100644 (file)
@@ -63,11 +63,11 @@ if ($bugsys->in['mark'] == 2)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0 Beta 2' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index c6c4b933cb529784e5ed0c6a43da7e5be0613510..0c17cc1425375f928099ad010e10e2834fd36944 100644 (file)
@@ -56,7 +56,7 @@ if ($bugsys->in['mark'] == 1)
                $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD groupids TEXT NULL");
                echo "Adding user.groupids<br />\n";
        }
-       
+
        build_usergroups();
        build_statuses();
        build_priorities();
@@ -67,7 +67,7 @@ if ($bugsys->in['mark'] == 1)
        build_versions();
        build_languages();
        build_user_help();
-       
+
        if ($db->query("SELECT * FROM " . TABLE_PREFIX . "component"))
        {
                $db->query("DROP TABLE " . TABLE_PREFIX . "component");
@@ -85,11 +85,11 @@ if ($bugsys->in['mark'] == 2)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0 Beta 3' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index bf825ca022d7f411528c258eb3d1933c040bd3d6..69d2da5e1c34392785fbd76a650ef447a46c412c 100644 (file)
@@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0 Release Candidate 1' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index f0a45d54e2c39216e2a6075149bad5e9e4a6350c..0b422c9274bfd3f1ce56ab7391aa7d54473548ca 100644 (file)
@@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 1d562687125f17786e0fbac7e9461bdc16f3f547..0a0cf6333bbfefc95a98895441339cf28192ecf5 100644 (file)
@@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.1' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 85f68df5fd4c66a29cbc4c9ac4fe8d1ed52340cc..4d7233c8c10e022c47edbe9e1638952f3329215c 100644 (file)
@@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.2' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index bc55e38a8d8c0fcafc39e225ccb08d86b823266d..1a9ad51ad015377a7f8ebc2ad1acc2f80c19f625 100644 (file)
@@ -49,7 +49,7 @@ if ($bugsys->in['mark'] == 1)
 
 <p>Making minor schema changes so that permission mask fields are large enough for the high integer values.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bugfieldpermission CHANGE mask mask int unsigned NOT NULL DEFAULT 0");
        $db->query("ALTER TABLE " . TABLE_PREFIX . "permission CHANGE mask mask int unsigned NOT NULL DEFAULT 0");
 }
@@ -64,11 +64,11 @@ if ($bugsys->in['mark'] == 2)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.3' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 165b1afe2217c2866519b433b0c8863caae6b309..556e0b79106ff1c5298c1510a84bc66279e51a14 100644 (file)
@@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.4' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 66aea3beef6e36dc8a9ce6072e91843d77be48bf..f993537f65584d2b588334141656b31d92ff20af 100644 (file)
@@ -47,10 +47,10 @@ if ($bugsys->in['mark'] == 1)
 {
 ?>
        <h1>Major Table Changes</h1>
-       
+
        <p>Major table additions and deletions are being performed on your database.</p>
 <?php
-       
+
        $db->query("
                CREATE TABLE " . TABLE_PREFIX . "useremail
                (
@@ -59,11 +59,11 @@ if ($bugsys->in['mark'] == 1)
                        mask int unsigned not null
                )
        ");
-       
+
        echo "Adding the useremail table to store email preferences<br />\n";
 
        $db->query("DROP TABLE " . TABLE_PREFIX . "dependency");
-       
+
        echo "Dropping the unused dependency table (this was never used and was from a 1.0.0 pre-release version, so data has been lost)<br />\n";
 }
 
@@ -73,21 +73,21 @@ if ($bugsys->in['mark'] == 2)
 {
 ?>
        <h1>User Table Changes</h1>
-       
+
        <p>Changes are now being done on the user table.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD usedst BOOL NOT NULL");
-       
+
        echo "Adding user.usedst, a daylight savings time option<br />\n";
 
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD hidestatuses mediumtext NOT NULL");
-       
+
        echo "Adding user.hidestatuses to allow users to opt to not display certain statuses<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD defaultsortkey varchar(50) NULL");
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD defaultsortas varchar(10) NULL");
-       
+
        echo "Adding user.defaultsortkey and user.defaultsortas for bug list sorting options<br />\n";
 }
 
@@ -97,28 +97,28 @@ if ($bugsys->in['mark'] == 3)
 {
 ?>
        <h1>Minor Table Changes</h1>
-       
+
        <p>Minor, miscellaneous modifications are now being performed on database tables.</p>
 <?php
-       
+
        $db->query("DELETE FROM " . TABLE_PREFIX . "search");
-       
+
        echo "Clearing the search table because new features make changes to the way data is stored in this table<br />\n";
 
        $db->query("ALTER TABLE " . TABLE_PREFIX . "search ADD resultcount INT(10) NULL");
-       
+
        echo "Adding search.resultcount as an internal counter for search features<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug CHANGE productid product INT(10) UNSIGNED NOT NULL DEFAULT '0'");
-       
+
        echo "Renaming bug.productid to bug.product<br />\n";
 
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug CHANGE componentid component INT(10) UNSIGNED NOT NULL DEFAULT '0'");
-       
+
        echo "Renaming bug.componentid to bug.component<br />\n";
 
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug CHANGE versionid version INT(10) UNSIGNED NOT NULL DEFAULT '0'");
-       
+
        echo "Renaming bug.versionid to bug.version<br />\n";
 }
 
@@ -128,25 +128,25 @@ if ($bugsys->in['mark'] == 4)
 {
 ?>
        <h1>Caching User Data in Bug Table</h1>
-       
+
        <p>To decrease load times and complex queries, user information is now stored in the bug table. This step will add additional fields for this data and then will populate those same fields.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD username varchar(255) NOT NULL");
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD lastpostbyname varchar(255) NOT NULL");
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bug ADD hiddenlastpostbyname varchar(255) NOT NULL");
-       
+
        echo "Adding bug.username, bug.lastpostbyname, and bug.hiddenlastpostbyname to store cached user name data<br />\n";
-       
+
        echo "Caching bug data";
-       
+
        $userlist = array();
        $users = $db->query("SELECT userid, displayname FROM " . TABLE_PREFIX . "user");
        while ($user = $db->fetch_array($users))
        {
                $userlist["$user[userid]"] = $user['displayname'];
        }
-       
+
        $bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug");
        while ($bug = $db->fetch_array($bugs))
        {
@@ -159,7 +159,7 @@ if ($bugsys->in['mark'] == 4)
                ");
                echo ".";
        }
-       
+
        echo " done<br />\n";
 }
 
@@ -169,12 +169,12 @@ if ($bugsys->in['mark'] == 5)
 {
 ?>
        <h1>Updating Old History Items</h1>
-       
+
        <p>In Bugdar 1.1.0, the bug history feature has been improved significantly. To bring old history messages up to date, processing has to be done. Please wait while historical records are updated.</p>
 <?php
-       
+
        echo "Updating historical records";
-       
+
        $history = $db->query("SELECT * FROM " . TABLE_PREFIX . "history");
        while ($log = $db->fetch_array($history))
        {
@@ -208,7 +208,7 @@ if ($bugsys->in['mark'] == 5)
                }
                echo ".";
        }
-       
+
        echo " done<br />\n";
 }
 
@@ -221,9 +221,9 @@ if ($bugsys->in['mark'] == 6)
 
 <p>In Bugdar 1.1.0, users can receive email notifications on various bug events. We are now setting the default email settings for all users.</p>
 <?php
-       
+
        echo "Setting email options";
-       
+
        $users = $db->query("SELECT userid FROM " . TABLE_PREFIX . "user");
        while ($user = $db->fetch_array($users))
        {
@@ -241,7 +241,7 @@ if ($bugsys->in['mark'] == 6)
                ");
                echo ".";
        }
-       
+
        echo " done<br />\n";
 }
 
@@ -255,18 +255,18 @@ if ($bugsys->in['mark'] == 7)
 <p>This step finishes the upgrade by inreasing your version number and then updating other settings.</p>
 
 <?php
-       
+
        require_once('./includes/settings.php');
-               
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0 Beta 1' WHERE varname = 'trackerversion'");
-       
+
        $db->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('syndicateditems', '" . $settings['general']['syndicateditems'][1] . "')");
        $db->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('hidestatuses', '" . $settings['display']['hidestatuses'][1] . "')");
        $db->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('defaultsortkey', '" . $settings['display']['defaultsortkey'][1] . "')");
        $db->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('defaultsortas', '" . $settings['display']['defaultsortas'][1] . "')");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 956251f615d8a6f0d1af7b62ca4cbaf03e455586..0eefb99a5c8ecdb57c6fe111fbb713463c7cc8ff 100644 (file)
@@ -47,28 +47,28 @@ if ($bugsys->in['mark'] == 1)
 {
 ?>
        <h1>Language System Updates</h1>
-       
+
        <p>In Bugdar 1.1.0 Beta 2, the language system was changed to use Gettext. These schema changes reflect that change.</p>
 <?php
-       
+
        $db->query("DROP TABLE " . TABLE_PREFIX . "localization");
-       
+
        echo "Dropping the strings cache table<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP filename");
-       
+
        echo "Dropping language.filename<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "language CHANGE languagecode langcode VARCHAR(5) NOT NULL");
-       
+
        echo "Adding language.langcode for the Gettext language code<br />\n";
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP debug");
-       
+
        echo "Dropping language.debug as language debug mode no longer exists<br />\n";
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "language SET langcode = 'en_US' WHERE languageid = 1");
-       
+
        echo "Setting the correct langcode for English (US)<br />\n";
 }
 
@@ -78,16 +78,16 @@ if ($bugsys->in['mark'] == 2)
 {
 ?>
        <h1>English US Changes</h1>
-       
+
        <p>These changes bring the schema into English (US) compliance.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "favourite RENAME " . TABLE_PREFIX . "favorite");
-       
+
        echo "Renaming table 'favourite' to 'favorite'<br />\n";
 
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user CHANGE showcolours showcolors BOOL NULL");
-       
+
        echo "Renaming user.showcolours to user.showcolors<br />\n";
 }
 
@@ -97,12 +97,12 @@ if ($bugsys->in['mark'] == 3)
 {
 ?>
        <h1>Adding New Permission Mask</h1>
-       
+
        <p>Bugdar 1.1.0 Beta 2 introduces a new permission called "canviewownhidden" which enables users to view hidden bugs that they reported. This is being turned on for registered users, developers, and administrators.</p>
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "usergroup SET permissions = permissions + 33554432 WHERE usergroupid IN (2, 5, 6)");
-       
+
        echo "Increased permission levels<br />\n";
 }
 
@@ -116,11 +116,11 @@ if ($bugsys->in['mark'] == 4)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0 Beta 2' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index d66dd63d6cf2cf2838f9cd1e14e63d4eb4c9d4ae..300ca39c0fdf96782c43c45b1a1a171e92e25cd1 100644 (file)
@@ -51,11 +51,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0 Release Candidate 1' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 902f94c367cdf057661118c5d93cc8653fc203f0..4ac551f9a8a49c60df928129c25dfd7427970199 100644 (file)
@@ -48,19 +48,19 @@ if ($bugsys->in['mark'] == 1)
 {
 ?>
        <h1>Rename Automatic Actions</h1>
-       
+
        <p>Simply for aesthetic's sake, we've ranamed "Automatic Actions" to "Automations." This does all the necessary database changes to make that rename work internally.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "autoaction RENAME " . TABLE_PREFIX . "automation");
        echo "Renaming datbase table<br />\n";
-       
+
        $db->query("DELETE FROM " . TABLE_PREFIX . "datastore WHERE title = 'autoaction'");
        echo "Clearing old datastore information<br />\n";
-       
+
        build_automations();
        echo "Rebuilding the automations cahce<br />\n";
-       
+
        $topic = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = 'newreply'");
        if (md5($topic['body']) == '7e1154340454ca6d8f8ba47aab057c23')
        {
@@ -85,11 +85,11 @@ if ($bugsys->in['mark'] == 2)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 53dab2f0e15d64f7e505e7d8fba0e766f41f0b48..22acfa40a0c86843198d7e3ccccea93f305b4169 100644 (file)
@@ -52,11 +52,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.1' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index e691ce15e7a7a8291e8dc86d5a77ed9fda23a2ce..90b58c405db4d4545d58856fbb19ee29c7cafba6 100644 (file)
@@ -52,11 +52,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.2' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 7d88cbd916078631e63474443ae449f9f3f38af5..b2ae7e699135553d9f801139c440fbb43b7d7156 100644 (file)
@@ -52,11 +52,11 @@ if ($bugsys->in['mark'] == 1)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.3' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 973c8688bdd8836f5c6bffc70cd24f59ac4570fc..20b09af8a1b73160f04fce6e857aa7dc01a4d407 100644 (file)
@@ -49,9 +49,9 @@ if ($bugsys->in['mark'] == 1)
 
 <p>Changing the storage type of the time zone field from INT to FLOAT to fix a bug.</p>
 <?php
-       
+
        $db->query("ALTER TABLE " . TABLE_PREFIX . "user CHANGE timezone timezone float(4) NOT NULL DEFAULT 0");
-       
+
        echo "... done<br />\n";
 }
 
@@ -65,11 +65,11 @@ if ($bugsys->in['mark'] == 2)
 <p>This step finishes the upgrade by inreasing your version number.</p>
 
 <?php
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.4' WHERE varname = 'trackerversion'");
-       
+
        build_settings();
-       
+
 ?>
 
 ... done.
index 92f9f5d497adb6fcff30fac8e5eddb9f060536b8..95c9fdf91bbc6502b8c7d203a84e20b723783527 100644 (file)
--- a/login.php
+++ b/login.php
@@ -57,7 +57,7 @@ if ($_POST['do'] == 'login' OR $_POST['do'] == 'cplogin')
        {
                $keeplogin = 0;
        }
-       
+
        if ($_SERVER['HTTP_REFERER'] AND !$_POST['goindex'])
        {
                $url = $_SERVER['HTTP_REFERER'];
@@ -66,7 +66,7 @@ if ($_POST['do'] == 'login' OR $_POST['do'] == 'cplogin')
        {
                $url = 'index.php';
        }
-       
+
        if ($auth->authenticateLogin($bugsys->in['email'], $bugsys->in['password'], $keeplogin))
        {
                if ($_POST['do'] == 'cplogin')
@@ -104,12 +104,12 @@ if ($_REQUEST['do'] == 'logout')
 // ###################################################################
 
 if ($_POST['do'] == 'sendpw')
-{      
+{
        $user = new UserAPI($bugsys);
        $user->set('email', $bugsys->in['email'], true, false); // don't verify so we don't get errors about existing emails
        $user->set_condition(array('email'));
        $user->fetch();
-       
+
        if ($message->hasErrors())
        {
                $show['lostpwerror'] = true;
@@ -119,15 +119,15 @@ if ($_POST['do'] == 'sendpw')
        {
                $activator = $funct->rand(25);
                $db->query("INSERT INTO " . TABLE_PREFIX . "passwordreset (activatorid, dateline, userid) VALUES ('" . $activator . "', " . TIMENOW . ", " . $user->objdata['userid'] . ")");
-               
+
                eval('$email = "' . $template->fetch(FetchEmailPath('passwordreset.xml', bugdar::$datastore['language'][$user->objdata['languageid']]['langcode'])) . '";');
                $email = $bugsys->xml->parse($email);
-               
+
                $mail->setSubject($email['email']['subject']['value']);
                $mail->setBodyText($email['email']['bodyText']['value']);
-               
+
                $mail->send($user->objdata['email'], $user->objdata['displayname']);
-               
+
                $message->message(sprintf(T('An email has been dispatched to %1$s that contains instructions on how to reset your password.'), $user->objdata['email']));
        }
 }
@@ -145,18 +145,18 @@ if ($_POST['do'] == 'resetpw')
 {
        // remove old activators
        $db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE dateline < " . (TIMENOW - 86400));
-       
+
        // now look for ours
        $activation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'");
        if (!$activation)
        {
                $message->error(L_INVALID_ID);
        }
-       
+
        $user = new UserAPI($bugsys);
        $user->set('userid', $activation['userid']);
        $user->set_condition();
-       
+
        if ($bugsys->in['fix_password'] != $bugsys->in['confirm_password'])
        {
                $message->addError(T('The passwords you entered do not patch.'));
@@ -165,14 +165,14 @@ if ($_POST['do'] == 'resetpw')
        {
                $message->addError(T('Your new password cannot be empty.'));
        }
-       
+
        $user->set('password', $bugsys->in['fix_password']);
-       
+
        if (!$message->hasErrors())
        {
                // remove old other activators for this user
                $db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE userid = " . $activation['userid']);
-               
+
                $user->update();
                $message->redirect(T('Your password has been changed successfully. You will now be redirected to the login page.'), 'login.php');
        }
@@ -189,14 +189,14 @@ if ($_REQUEST['do'] == 'recoverpw')
 {
        // remove old activators
        $db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE dateline < " . (TIMENOW - 86400));
-       
+
        // now look for ours
        $activation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'");
        if (!$activation)
        {
                $message->error(T('Invalid activation reset key. Please make sure you copied the URL exactly as it appeared in the email.'));
        }
-       
+
        eval('$template->flush("' . $template->fetch('passwordreset') . '");');
 }
 
index 72e193f67165607096485d76636b037e87b23d1d..f66f265cc754af896d7c33c3900d1a54a43fdaea 100644 (file)
@@ -54,18 +54,18 @@ if ($_POST['do'] == 'insert')
 {
        $bug = new BugAPI($bugsys);
        $comment = new CommentAPI($bugsys);
-       
+
        $notif = new NotificationCenter();
-               
+
        $bug->set('userid',                     $bugsys->userinfo['userid']);
        $bug->set('username',           $bugsys->userinfo['displayname']);
        $bug->set('summary',            $bugsys->in['summary']);
        $bug->set('severity',           $bugsys->in['severity']);
-       
+
        $comment->set('userid',         $bugsys->userinfo['userid']);
        $comment->set('comment',        $bugsys->in['comment']);
        $comment->set('parselinks',     $bugsys->in['parselinks']);
-       
+
        // -------------------------------------------------------------------
        // check permissions on various input values
        if (!can_perform('canchangestatus', $bugsys->in['product']))
@@ -89,23 +89,23 @@ if ($_POST['do'] == 'insert')
                // assigned person is not a dev or a valid user
                $bug->set('assignedto', $bugsys->in['assignedto']);
        }
-               
+
        $product = explode(',', $bugsys->in['product']);
        $bug->set('product',            $product[0]);
        $bug->set('component',          $product[1]);
        $bug->set('version',            $product[2]);
-       
+
        process_custom_fields($bug, $message, true);
-       
+
        if (!$message->hasErrors())
        {
                $bug->insert();
-               
+
                $comment->set('bugid',                  $bug->insertid);
                $comment->insert();
-               
+
                $notif->send_new_bug_notice($bug->values, $comment->values);
-               
+
                $bug = new BugAPI($bugsys); // need to destroy because update will think the insert fields need to be changed, too
                $bug->dorelations = array();
                $bug->set('bugid',                                      $comment->values['bugid']);
@@ -120,11 +120,11 @@ if ($_POST['do'] == 'insert')
                $bug->set('hiddenlastpostby',           $bugsys->userinfo['userid']);
                $bug->set('hiddenlastpostbyname',       $bugsys->userinfo['displayname']);
                $bug->update();
-               
+
                $notif->set_bug_data($bug->objdata);
-               
+
                $notif->finalize();
-               
+
                $message->redirect(T('The bug has been added to the database.'), ($bugsys->in['submit_reload'] == '' ? "showreport.php?bugid=" . $bug->values['bugid'] : 'newreport.php'));
        }
        else
@@ -146,20 +146,20 @@ if ($_REQUEST['do'] == 'add')
        {
                $message->error(T('No versions have been setup underneath your product(s), therefore no bugs can be added.'));
        }
-       
+
        $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : $bugsys->options['defaultseverity']));
 
        $show['changestatus'] = can_perform('canchangestatus');
-       
+
        if (can_perform('canchangestatus'))
        {
                $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', ($bugsys->in['priority'] ? $bugsys->in['priority'] : $bugsys->options['defaultpriority']));
                $select['status'] = construct_datastore_select('status', 'status', 'statusid', ($bugsys->in['status'] ? $bugsys->in['status'] : $bugsys->options['defaultstatus']));
                $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', ($bugsys->in['resolution'] ? $bugsys->in['resolution'] : $bugsys->options['defaultresolve']));
        }
-       
+
        $show['assign'] = can_perform('canassign');
-       
+
        if (can_perform('canassign'))
        {
                foreach (bugdar::$datastore['assignto'] AS $dev)
@@ -170,9 +170,9 @@ if ($_REQUEST['do'] == 'add')
                        eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
                }
        }
-       
+
        // custom fields
-       $fields = construct_custom_fields($bugsys->in, true);           
+       $fields = construct_custom_fields($bugsys->in, true);
        $i = 0;
        foreach ($fields AS $field)
        {
@@ -186,11 +186,11 @@ if ($_REQUEST['do'] == 'add')
                }
                $i++;
        }
-       
+
        $productSelect = ConstructProductSelect('cansubmitbugs', $bugsys->in['product'], false);
-       
+
        $reporter = construct_user_display($bugsys->userinfo);
-       
+
        eval('$template->flush("' . $template->fetch('newreport') . '");');
 }
 
index 84e17c816ea4af604268c8928a5829ffd93b7a6e..766e153d8b5b2fc536ded7d181d58a104a4632c7 100644 (file)
@@ -40,7 +40,7 @@ if ($_POST['do'] == 'insert')
        {
                $message->error(T('Sorry, you are already registered.'));
        }
-       
+
        if (!$bugsys->options['allownewreg'])
        {
                $message->error(T('Sorry, we don\'t allow new registrations.'));
@@ -50,12 +50,12 @@ if ($_POST['do'] == 'insert')
        {
                $message->addError(T('The emails you entered do not match.'));
        }
-       
+
        if ($bugsys->in['password'] != $bugsys->in['confirmpassword'])
        {
                $message->addError(T('The passwords you entered did not match.'));
        }
-                       
+
        if ($bugsys->options['verifyemail'])
        {
                $usergroupid = 3;
@@ -71,7 +71,7 @@ if ($_POST['do'] == 'insert')
                        $usergroupid = 2;
                }
        }
-       
+
        $user = new UserAPI($bugsys);
        $user->set('email',                     $bugsys->in['email']);
        $user->set('displayname',       $bugsys->in['displayname']);
@@ -81,27 +81,27 @@ if ($_POST['do'] == 'insert')
        $user->set('languageid',        $bugsys->in['languageid']);
        $user->set('timezone',          $bugsys->options['defaulttimezone']);
        $user->set('usergroupid',       $usergroupid);
-       
+
        if (!$message->hasErrors())
        {
                $user->insert();
-               
+
                $userid = $user->insertid;
-               
+
                // Verify email address
                if ($usergroupid == 3)
                {
                        $activationid = $funct->rand(25);
-                       
+
                        $db->query("INSERT INTO " . TABLE_PREFIX . "useractivation (userid, activator, dateline, usergroupid) VALUES ($userid, '$activationid', " . TIMENOW . ", 2)");
-                       
+
                        eval('$email = "' . $template->fetch(FetchEmailPath('activateaccount.xml', bugdar::$datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";');
                        $email = $bugsys->xml->parse($email);
                        $mail->setSubject($email['email']['subject']['value']);
                        $mail->setBodyText($email['email']['bodyText']['value']);
-                       
+
                        $mail->send($bugsys->in['email'], $bugsys->in['displayname']);
-               
+
                        $message->message(T('You now need to activate your account via email.'));
                }
                else if ($usergroupid == 4 OR $usergroupid == 2)
@@ -115,7 +115,7 @@ if ($_POST['do'] == 'insert')
                                $mail->setBodyText($email['email']['bodyText']['value']);
                                $mail->send($bugsys->in['email'], $bugsys->in['displayname']);
                        }
-                       
+
                        if ($usergroupid == 4)
                        {
                                $message->message(T('Your account is pending approval.'));
@@ -141,7 +141,7 @@ if (empty($_REQUEST['do']))
        {
                $message->error(T('Sorry, you are already registered.'));
        }
-       
+
        if (!$bugsys->options['allownewreg'])
        {
                $message->error(T('Sorry, we don\'t allow new registrations.'));
@@ -153,7 +153,7 @@ if (empty($_REQUEST['do']))
                $selected = ($value == $bugsys->in['languageid']);
                eval('$opts .= "' . $template->fetch('selectoption') . '";');
        }
-       
+
        eval('$template->flush("' . $template->fetch('register') . '");');
 }
 
@@ -167,7 +167,7 @@ if ($_REQUEST['do'] == 'activate')
                $user = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $bugsys->in['userid']);
                $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = $useractivation[usergroupid] WHERE userid = " . $bugsys->in['userid']);
                $db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $bugsys->in['userid']);
-               
+
                if ($bugsys->options['sendwelcomemail'])
                {
                        $displayName = $user['displayname'];
@@ -177,7 +177,7 @@ if ($_REQUEST['do'] == 'activate')
                        $mail->setBodyText($email['email']['bodyText']['value']);
                        $mail->send($user['email'], $user['displayname']);
                }
-               
+
                $message->message(T('Your account is now activated and you can now login.'));
        }
        else
index 4c71934cc9631bf55c82fa3cdae84327a03ae2fd..d04b40b95267cee9e463149f1eda45edee5aa7f4 100644 (file)
@@ -85,7 +85,7 @@ if ($_REQUEST['do'] == 'search')
        {
                $newsearch = true;
        }
-       
+
        if ($cachedsearch)
        {
                $show['cached'] = true;
@@ -99,30 +99,30 @@ if ($_REQUEST['do'] == 'search')
                {
                        $search = $cachedsearch;
                        $_POST['do'] = 'results';
-               }       
+               }
        }
        else
        {
                $newsearch = true;
        }
-       
+
        if ($newsearch)
        {
                if (!is_array(bugdar::$datastore['product']))
                {
                        $message->error(T('No products are setup, therefore there can be no bugs and thus search cannot function.'));
                }
-               
+
                if (!is_array(bugdar::$datastore['version']))
                {
                        $message->error(T('No versions have been added underneath your product(s), there can be no bugs and thus search cannot function.'));
                }
-               
+
                $productSelect = ConstructProductSelect();
-               
+
                // -------------------------------------------------------------------
                // custom fields
-               $fields = construct_custom_fields(null, true, false, true);             
+               $fields = construct_custom_fields(null, true, false, true);
                $i = 0;
                foreach ($fields AS $field)
                {
@@ -136,14 +136,14 @@ if ($_REQUEST['do'] == 'search')
                        }
                        $i++;
                }
-               
+
                // -------------------------------------------------------------------
-               // built-in fields      
+               // built-in fields
                $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid');
                $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid');
                $select['status'] = construct_datastore_select('status', 'status', 'statusid');
                $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid');
-               
+
                $searches = '';
                if ($bugsys->userinfo['userid'])
                {
@@ -155,7 +155,7 @@ if ($_REQUEST['do'] == 'search')
                                eval('$searches .= "' . $template->fetch('selectoption') . '";');
                        }
                }
-               
+
                $select['dev'] = '';
                foreach (bugdar::$datastore['assignto'] AS $dev)
                {
@@ -163,7 +163,7 @@ if ($_REQUEST['do'] == 'search')
                        $label = construct_user_display($dev, false);
                        eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
                }
-                               
+
                eval('$template->flush("' . $template->fetch('search') . '");');
        }
 }
@@ -177,16 +177,16 @@ if ($_REQUEST['do'] == 'process')
        if ($bugsys->in['summary'])
        {
                $keywords = preg_split('#\s+#', $bugsys->in['summary']);
-               
+
                // TODO - need to have some str to bool conversions
-               
+
                foreach ($keywords AS $word)
                {
                        if (strlen($word) < SEARCH_WORD_MIN)
                        {
                                continue;
                        }
-                       
+
                        $word = str_replace("'", "\'", $word);
                        if ($bugsys->in['mode'] == MODE_ALL)
                        {
@@ -196,27 +196,27 @@ if ($_REQUEST['do'] == 'process')
                        {
                                $querybuild['text'] .= " $word";
                        }
-                       
+
                        if (!preg_match('#-(.+?)#', trim($word)))
                        {
                                $hilight .= " $word";
                        }
                }
-               
+
                $hilight = preg_replace('#[^0-9a-zA-Z_ ]#', '', $hilight);
                $hilight = trim($hilight);
                $hilight = preg_replace('#\s#', '+', $hilight);
-               
+
                $temp = trim($querybuild['text']);
-               
+
                if ($bugsys->in['mode'] == MODE_ALL OR $bugsys->in['mode'] == MODE_RAW)
                {
                        $bool_flag = ' IN BOOLEAN MODE';
                }
-               
+
                $querybuild['text'] = "AND\n\t\t\t(\n\t\t\t\tMATCH (bug.summary) AGAINST ('$temp'$bool_flag)\n\t\t\t\tOR MATCH (comment.comment) AGAINST ('$temp'$bool_flag)\n\t\t\t)";
        }
-       
+
        // -------------------------------------------------------------------
        // reporter
        if ($bugsys->in['reporter'])
@@ -229,7 +229,7 @@ if ($_REQUEST['do'] == 'process')
                        $querybuild['reporter'] = "AND bug.userid = $user[userid] OR comment.userid = $user[userid]";
                }
        }
-       
+
        // -------------------------------------------------------------------
        // product/component/version stuff
        if (is_array($bugsys->in['product']))
@@ -244,45 +244,45 @@ if ($_REQUEST['do'] == 'process')
                }
                $querybuild['pcv'] = "AND bug.product IN (" . implode(',', $products) . ") AND bug.component IN (" . implode(',', $components) . ") AND bug.version IN (" . implode(',', $versions) . ")";
        }
-       
+
        // -------------------------------------------------------------------
        // severity, priority, status, resolution, assignedto
-       
+
        // severity
        if ($bugsys->in['severity'])
        {
                $bugsys->input_clean('severity', TYPE_UINT);
                $querybuild['severity'] = "AND bug.severity IN (" . implode(',', $bugsys->in['severity']) . ")";
        }
-       
+
        // priority
        if ($bugsys->in['priority'])
        {
                $bugsys->input_clean('priority', TYPE_UINT);
                $querybuild['priority'] = "AND bug.priority IN (" . implode(',', $bugsys->in['priority']) . ")";
        }
-       
+
        // status
        if ($bugsys->in['status'])
        {
                $bugsys->input_clean('status', TYPE_UINT);
                $querybuild['status'] = "AND bug.status IN (" . implode(',', $bugsys->in['status']) . ")";
        }
-       
+
        // resolution
        if ($bugsys->in['resolution'])
        {
                $bugsys->input_clean('resolution', TYPE_UINT);
                $querybuild['resolution'] = "AND bug.resolution IN (" . implode(',', $bugsys->in['resolution']) . ")";
        }
-       
+
        // assignment
        if ($bugsys->in['assignedto'])
        {
                $bugsys->input_clean('assignedto', TYPE_UINT);
                $querybuild['assignedto'] = "AND bug.assignedto IN (" . implode(',', $bugsys->in['assignedto']) . ")";
        }
-       
+
        // -------------------------------------------------------------------
        // date
        if ($bugsys->in['date'])
@@ -291,7 +291,7 @@ if ($_REQUEST['do'] == 'process')
                $dateline = time() - ($bugsys->input_clean('date', TYPE_INT) * 3600);
                $querybuild['date'] = "AND bug.dateline >= $dateline";
        }
-       
+
        // -------------------------------------------------------------------
        // favorites
        $bugsys->input_clean('favorite', TYPE_INT);
@@ -304,7 +304,7 @@ if ($_REQUEST['do'] == 'process')
                }
                $querybuild['favorites'] = "AND bug.bugid " . ($bugsys->in['favorite'] > 0 ? "IN" : "NOT IN") . " (" . implode(', ', $ids) . ")";
        }
-       
+
        // -------------------------------------------------------------------
        // sort by
        $sortby = array('bugid', 'severity', 'priority', 'status', 'resolution', 'dateline');
@@ -322,7 +322,7 @@ if ($_REQUEST['do'] == 'process')
        {
                $sortclause = '';
        }
-       
+
        // -------------------------------------------------------------------
        // custom fields
        $fields_fetch = $bugsys->db->query("
@@ -355,17 +355,17 @@ if ($_REQUEST['do'] == 'process')
                        }
                }
        }
-       
+
        // -------------------------------------------------------------------
        // have to search something
        if (sizeof($querybuild) < 1)
        {
                $message->error(sprintf(T('You have to enter some criteria to search for. Note that words less than %1$d characters are ignored by the search engine (and some other very common words, too).'), SEARCH_WORD_MIN));
        }
-       
+
        // -------------------------------------------------------------------
        // do the search
-       
+
        $search = $db->query("
                SELECT bug.*, comment.commentid
                FROM " . TABLE_PREFIX . "bug AS bug
@@ -385,32 +385,32 @@ if ($_REQUEST['do'] == 'process')
                GROUP BY bug.bugid
                $sortclause
        ");
-       
+
        $numrows = $db->num_rows($search);
-       
+
        if ($numrows < 1)
        {
                $message->error(T('No search results were returned that matched your criteria. Please <a href="search.php?new=1">try again</a> with different search requirements.'));
        }
-       
+
        while ($result = $db->fetch_array($search))
        {
                $ids[] = $result['bugid'];
                $results[] = $result;
        }
-               
+
        if ($bugsys->userinfo['userid'] AND !$cachedsearch AND !$bugsys->in['rerun'])
        {
                $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . $bugsys->userinfo['userid'] . " AND name IS NULL");
        }
-       
+
        // store the search params
        $params = $bugsys->in;
        foreach ($_COOKIE AS $key => $value)
        {
                unset($params["$key"]);
        }
-       
+
        if ($cachedsearch)
        {
                $search = $cachedsearch;
@@ -433,7 +433,7 @@ if ($_REQUEST['do'] == 'process')
                );
                $search = array('searchid' => $db->insert_id(), 'ids' => implode(',', $ids), 'orderby' => $sortclause, 'hilight' => $hilight, 'resultcount' => sizeof($results));
        }
-       
+
        $_POST['do'] = 'results';
 }
 
@@ -446,14 +446,14 @@ if ($_REQUEST['do'] == 'update')
        {
                $message->errorPermission();
        }
-       
+
        $productSelect = ConstructProductSelect();
-       
+
        $show['update'] = true;
-       
+
        // -------------------------------------------------------------------
        // custom fields
-       $fields = construct_custom_fields(null, true, false, true);             
+       $fields = construct_custom_fields(null, true, false, true);
        $i = 0;
        foreach ($fields AS $field)
        {
@@ -467,14 +467,14 @@ if ($_REQUEST['do'] == 'update')
                }
                $i++;
        }
-       
+
        // -------------------------------------------------------------------
-       // built-in fields      
+       // built-in fields
        $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', 0, 0);
        $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', 0, 0);
        $select['status'] = construct_datastore_select('status', 'status', 'statusid', 0, 0);
        $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', 0, 0);
-       
+
        $select['dev'] = '';
        $value = '0';
        $label = '';
@@ -487,7 +487,7 @@ if ($_REQUEST['do'] == 'update')
                $label = construct_user_display($dev, false);
                eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
        }
-               
+
        eval('$template->flush("' . $template->fetch('search_update') . '");');
 }
 
@@ -500,7 +500,7 @@ if ($_POST['do'] == 'doupdate')
        {
                $message->errorPermission();
        }
-       
+
        // find all the bugs that we can edit
        $bugs = $db->query("
                SELECT * FROM " . TABLE_PREFIX . "bug
@@ -519,12 +519,12 @@ if ($_POST['do'] == 'doupdate')
                {
                        continue;
                }
-                               
+
                $api = new BugApi($bugsys);
                $api->set('bugid', $bug['bugid']);
                $api->set_condition();
                $api->values = $bug;
-                               
+
                $log = new Logging();
                $log->set_bugid($bug['bugid']);
                $log->add_data(true, $bug, $log->getCommonFields(), true);
@@ -556,15 +556,15 @@ if ($_POST['do'] == 'doupdate')
                        $api->set('component',  $product[1]);
                        $api->set('version',    $product[2]);
                }
-               
+
                process_custom_fields($api, $message, false, true);
-               
+
                $log->add_data(false, $api->values, $log->getCommonFields(), true);
-                               
+
                $api->update();
                $log->update_history();
        }
-       
+
        $message->redirect(T('The specified bugs have been updated and you will now return to your search results.'), 'search.php?searchid=' . $bugsys->in['searchid']);
 }
 
@@ -584,14 +584,14 @@ if ($_REQUEST['do'] == 'export')
        {
                $message->error(T('The search results are trying to export are invalid. Please start over <a href="search.php?new=1">here</a> and try again.'));
        }
-       
+
        if (!$search)
        {
                $message->error(T('Your search has expired because it is older than one hour. Please start over <a href="search.php?new=1">here</a>.'));
        }
-       
+
        $bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($search[ids]) $search[orderby]");
-       
+
        $xml = '<?xml version="1.0" encoding="' . $language['charset'] . '"?>
 
 <bugdarExport user="' . $bugsys->unsanitize(construct_user_display($bugsys->userinfo, false)) . '" date="' . $datef->format('r', TIMENOW) . '" searchid="' . $search['searchid'] . '">';
@@ -599,9 +599,9 @@ if ($_REQUEST['do'] == 'export')
        while ($bug = $db->fetch_array($bugs))
        {
                $xml .= "\n\t<bug>";
-               
+
                $bug = ProcessBugDataForDisplay($bug);
-               
+
                $xml .= "\n\t\t<id>" . $bug['bugid'] . "</id>";
                $xml .= "\n\t\t<dateReported>" . $datef->format('r', $bug['dateline']) . "</dateReported>";
                if ($bug['userid'])
@@ -623,12 +623,12 @@ if ($_REQUEST['do'] == 'export')
                $xml .= "\n\t\t<resolution>" . $bug['resolution'] . "</resolution>";
                $xml .= "\n\t\t<severity>" . $bug['severity'] . "</severity>";
                $xml .= "\n\t\t<priority>" . $bug['priority'] . "</priority>";
-               
+
                $xml .= "\n\t</bug>";
        }
-       
+
        $xml .= "\n</bugdarExport>";
-       
+
        $funct->download_file($xml, T('bugdar-search-' . $search['searchid'] . '.xml'), true);
 }
 
@@ -649,7 +649,7 @@ if ($_POST['do'] == 'dosave')
        {
                $message->addError(T('The name cannot be empty.'));
        }
-       
+
        if (!$message->hasErrors())
        {
                $db->query("UPDATE " . TABLE_PREFIX . "search SET name = '" . $bugsys->input_escape('name') . "' WHERE searchid = " . $bugsys->in['searchid']);
@@ -670,31 +670,31 @@ if ($_REQUEST['do'] == 'save')
        {
                $message->errorPermission();
        }
-       
+
        eval('$template->flush("' . $template->fetch('search_save') . '");');
 }
 
 // ###################################################################
 
 if ($_POST['do'] == 'results')
-{      
+{
        if (!$search['ids'])
        {
                $message->error(T('No bugs matched your search criteria. Please <a href="search.php?new=1">try again</a> with different search requirements.'));
        }
-       
+
        $searchid = $search['searchid'];
        $hilight = $search['hilight'];
-               
+
        LoadPaginationFramework();
        $pagination->setTotal($search['resultcount']);
        $pagination->splitPages();
-       
+
        $sort = new ListSorter('search');
-       
+
        $show['save'] = ($bugsys->userinfo['userid'] AND !$search['name']);
        $show['update'] = can_perform('caneditother');
-       
+
        $bugs = '';
        $search = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($search[ids]) $search[orderby] LIMIT " . $pagination->fetchLimit($pagination->getPage() - 1) . ", " . $pagination->getPerPage());
        while ($bug = $db->fetch_array($search))
@@ -703,11 +703,11 @@ if ($_POST['do'] == 'results')
                $bug = ProcessBugDataForDisplay($bug, $funct->bgcolour);
                $bugs .= $sort->constructRow($bug, "&amp;hilight=$hilight");
        }
-       
+
        $columnHeads = $sort->constructColumnHeaders(false);
        $show['pagenav'] = ($pagination->getPageCount() > 1);
        $pagenav = $pagination->constructPageNav('search.php?searchid=' . $searchid);
-       
+
        eval('$template->flush("' . $template->fetch('search_results') . '");');
 }
 
index b3cd705041a9d5ce1b5776da73fe822c4321fc72..da3fbbb2af2c305201119249c41d07679fc6f5d9 100644 (file)
@@ -52,7 +52,7 @@ if (empty($bugid) OR $_REQUEST['do'] == 'quicksearch')
                        $error = L_INVALID_ID;
                }
        }
-       
+
        eval('$template->flush("' . $template->fetch('quicksearch') . '");');
        exit;
 }
@@ -87,13 +87,13 @@ $show['delete'] = can_perform('candeletedata', $bug['product']);
 if ($show['edit'])
 {
        $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', $bug['severity']);
-       
+
        $show['changestatus'] = (can_perform('canchangestatus', $bug['product']) ? true : false);
        if (can_perform('canchangestatus', $bug['product']))
        {
                $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', $bug['priority']);
                $select['status'] = construct_datastore_select('status', 'status', 'statusid', $bug['status']);
-               $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', $bug['resolution']);             
+               $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', $bug['resolution']);
        }
        else
        {
@@ -102,7 +102,7 @@ if ($show['edit'])
                $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity'];
                $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority'];
        }
-       
+
        $show['assign'] = (can_perform('canassign', $bug['product']) ? true : false);
        if (can_perform('canassign', $bug['product']) AND is_array(bugdar::$datastore['assignto']))
        {
@@ -114,14 +114,14 @@ if ($show['edit'])
                        eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
                }
        }
-       
+
        $productSelect = ConstructProductSelect('canviewbugs', "$bug[product],$bug[component],$bug[version]");
-       
+
        if ($bug['duplicateof'])
        {
                $duplicate = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]");
        }
-       
+
        if ($bug['dependency'])
        {
                $depends = array();
@@ -132,7 +132,7 @@ if ($show['edit'])
                }
                $dependencies = implode(' ', $depends);
        }
-       
+
        $select['automations'] = '';
        $show['automations'] = false;
        if (is_array(bugdar::$datastore['automation']))
@@ -165,12 +165,12 @@ else
        $bug['resolution'] = bugdar::$datastore['resolution']["$bug[resolution]"]['resolution'];
        $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity'];
        $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority'];
-       
+
        $assigninfo = bugdar::$datastore['assignto']["$bug[assignedto]"];
        $bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assigninfo) : '');
-               
+
        $duplicateof = $db->query_first("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]");
-       
+
        $dupelist = array();
        $duplicates = $db->query("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE duplicateof = $bug[bugid]");
        while ($duplicate = $db->fetch_array($duplicates))
@@ -178,7 +178,7 @@ else
                $dupelist[] = "<a href=\"showreport.php?bugid=$duplicate[bugid]\" target=\"_blank\">$duplicate[summary]</a>";
        }
        $dupelist = implode(', ', $dupelist);
-       
+
        if ($bug['dependency'])
        {
                $depends = array();
@@ -260,7 +260,7 @@ if ($show['getattachments'] OR $show['putattachments'])
                WHERE attachment.bugid = $bug[bugid]
                ORDER BY attachment.dateline"
        );
-       
+
        $attaches = false;
        while ($attachment = $db->fetch_array($attachments_fetch))
        {
@@ -270,7 +270,7 @@ if ($show['getattachments'] OR $show['putattachments'])
                $attachment['user'] = construct_user_display($attachment, false);
                eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";');
        }
-       
+
        $show['attachments'] = (!$show['putattachments'] AND !$attaches) ? false : true;
 }
 
@@ -450,11 +450,11 @@ while ($comment = $db->fetch_array($comments_fetch))
        $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']);
        $comment['postby'] = construct_user_display($comment);
        $show['editcomment'] = ((can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid']));
-       
+
        $bugsys->debug('can edit own replies: ' . (int)(can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']));
        $bugsys->debug('can edit other replies:' . (int)(can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid']));
        $bugsys->debug('$show[editcomment]: ' . $show['editcomment']);
-       
+
        if (is_array($hilight))
        {
                foreach ($hilight AS $id => $find)
@@ -464,7 +464,7 @@ while ($comment = $db->fetch_array($comments_fetch))
                        $comment['comment_parsed'] = preg_replace($find, $replace, $comment['comment_parsed']);
                }
        }
-       
+
        eval('$temp = "' . $template->fetch('showreport_comment') . '";');
        if ($description == null)
        {
index cd9ff6f792c85a837c07890933915b604a39d454..cfa31c9724655ace1fa4ec4d5911c7edf5921404 100644 (file)
@@ -78,13 +78,13 @@ while ($bug = $db->fetch_array($bugs_fetch))
                                <td><strong>' . T('Severity') . ':</strong></td>
                                <td>' . bugdar::$datastore['severity']["$bug[severity]"]['severity'] . '</td>
                        </table>
-                       
+
                        <p>' . $bug['comment_parsed'] . '</p>') . '
                </content>
                <summary type="text">' . htmlspecialchars($bug['comment_parsed']) . '</summary>
                <link rel="alternate" href="' . $bugsys->options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
        </entry>';
-       
+
        $lastupdated = $bug["$timestamp"];
 }
 
@@ -94,12 +94,12 @@ echo '<?xml version="1.0" encoding="' . $language['charset'] . '"?>
        <title>' . sprintf(T('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . '</title>
        <link href="' . $bugsys->options['trackerurl'] . '"/>
        <updated>' . gmdate('Y-m-d\TH:i:s\Z', $lastupdated) . '</updated>
-       
+
        <!-- entries -->
        ';
 
 echo $syndicate;
-       
+
 echo '
        <!-- / entries -->
 
index a6cb70d2a1741780fa855457c505a7c31e673d26..566e155fe0cfb471df08dc410ad6a53f87b52fed 100644 (file)
@@ -61,9 +61,9 @@ if ($_POST['do'] == 'killsearch')
        {
                $message->errorPermission();
        }
-       
+
        $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->in['searchid']);
-       
+
        $message->redirect(T('This saved search has been removed from your list.'), 'userctrl.php');
 }
 
@@ -76,14 +76,14 @@ if ($_REQUEST['do'] == 'deletesearch')
        {
                $message->errorPermission();
        }
-       
+
        $message->confirm(T('Are you sure you want to delete this saved search?'), 'userctrl.php', 'killsearch', T('Delete'), T('Cancel'), array('searchid' => $bugsys->in['searchid']));
 }
 
 // ###################################################################
 
 if ($_POST['do'] == 'update')
-{      
+{
        // -------------------------------------------------------------------
        // authentication
        if (!empty($bugsys->in['password_change']) OR !empty($bugsys->in['email_change']))
@@ -100,7 +100,7 @@ if ($_POST['do'] == 'update')
                        }
                }
        }
-       
+
        // -------------------------------------------------------------------
        // email validation
        if (!empty($bugsys->in['email_change']))
@@ -109,15 +109,15 @@ if ($_POST['do'] == 'update')
                {
                        $message->addError(T('You need to enter both the email and confirm email fields to change your address'));
                }
-               
+
                if ($bugsys->in['email_change'] != $bugsys->in['email_confirm'])
                {
                        $message->addError(T('Your email and confirm email addresses do not match'));
                }
-               
+
                $userapi->set('email',  $bugsys->in['email_change']);
        }
-       
+
        // -------------------------------------------------------------------
        // password validation
        if (!empty($bugsys->in['password_change']))
@@ -133,10 +133,10 @@ if ($_POST['do'] == 'update')
                                $message->addError(T('Your password and confirm password do not match'));
                        }
                }
-               
+
                $userapi->set('password',       $bugsys->in['password_change']);
        }
-       
+
        $userapi->set('displayname',    $bugsys->in['displayname']);
        $userapi->set('showemail',              $bugsys->in['showemail']);
        $userapi->set('showcolors',             $bugsys->in['showcolors']);
@@ -147,7 +147,7 @@ if ($_POST['do'] == 'update')
        $userapi->set('defaultsortkey', $bugsys->in['defaultsortkey']);
        $userapi->set('defaultsortas',  $bugsys->in['defaultsortas']);
        $userapi->set('columnoptions',  $bugsys->input_clean('columnoptions', TYPE_UINT));
-               
+
        // -------------------------------------------------------------------
        // copy fields
        $userinfo['displayname'] = $bugsys->in['displayname'];
@@ -160,10 +160,10 @@ if ($_POST['do'] == 'update')
        $userinfo['defaultsorkey'] = $bugsys->in['defaultsorkey'];
        $userinfo['defaultsortas'] = $bugsys->in['defaultsortas'];
        $userinfo['columnoptions'] = $bugsys->in['columnoptions'];
-       
+
        $email = $bugsys->in['email_change'];
        $email_confirm = $bugsys->in['email_confirm'];
-       
+
        // -------------------------------------------------------------------
        // error handling
        if ($message->hasErrors())
@@ -174,7 +174,7 @@ if ($_POST['do'] == 'update')
        else
        {
                $userapi->update();
-               
+
                $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $bugsys->userinfo['userid']);
                $bugsys->input_clean('emailopts', TYPE_INT);
                if (is_array($bugsys->in['emailopts']))
@@ -192,7 +192,7 @@ if ($_POST['do'] == 'update')
                                $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . $bugsys->userinfo['userid'] . ", $relation, $bitmask)");
                        }
                }
-               
+
                $message->redirect(T('The changes to your account have been made.'), 'userctrl.php');
        }
 }
@@ -202,19 +202,19 @@ if ($_POST['do'] == 'update')
 if ($_REQUEST['do'] == 'modify')
 {
        $langselect = construct_datastore_select('language', 'title', 'languageid', $userinfo['languageid']);
-       
+
        $hidestatuses = construct_datastore_select('status', 'status', 'statusid', (!is_array($userinfo['hidestatuses']) ? explode(',', $userinfo['hidestatuses']) : $userinfo['hidestatuses']), 0);
        $hidestatusesnum = (sizeof(bugdar::$datastore['status']) < 8 ? sizeof(bugdar::$datastore['status']) + 1 : 8);
-       
+
        $defaultsortkey = construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $userinfo['defaultsortkey']);
        $defaultsortas = construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $userinfo['defaultsortas']);
-       
+
        foreach ($datef->fetch_timezone_list() AS $value => $label)
        {
                $selected = ($value == $userinfo['timezone']);
                eval('$tzselect .= "' . $template->fetch('selectoption') . '";');
        }
-       
+
        $checked = array();
        if (!is_array($bugsys->in['emailopts']))
        {
@@ -247,7 +247,7 @@ if ($_REQUEST['do'] == 'modify')
                        }
                }
        }
-       
+
        $columns = array();
        $columnOptions = '';
        if (!is_array($bugsys->in['columnoptions']))
@@ -273,7 +273,7 @@ if ($_REQUEST['do'] == 'modify')
                        eval('$columnOptions .= "' . $template->fetch('userctrl_column') . '";');
                }
        }
-       
+
        // searches
        $searches = '';
        $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . $bugsys->userinfo['userid']);
@@ -281,7 +281,7 @@ if ($_REQUEST['do'] == 'modify')
        {
                eval('$searches .= "' . $template->fetch('userctrl_search') . '";');
        }
-       
+
        eval('$template->flush("' . $template->fetch('userctrl') . '");');
 }
 
index 6165703e88e14671d72a50367a95fed4b4fa305c..2507b354871ea751ac3fd89803e91bef8e964f77 100644 (file)
--- a/vote.php
+++ b/vote.php
@@ -37,27 +37,27 @@ if ($_REQUEST['do'] == 'vote')
 {
        $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->input_clean('bugid', TYPE_UINT));
        $vote =  $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]");
-       
+
        if (!check_bug_permissions($bug))
        {
                $message->errorPermission();
        }
-       
+
        if (!can_perform('canvote', $bug['product']))
        {
                $message->errorPermission();
        }
-       
+
        if (!$bug)
        {
                $message->error(L_INVALID_ID);
        }
-       
+
        if ($vote['uservote'])
        {
                $message->error(T('You have already voted on this bug.'));
        }
-       
+
        // handle userids
        $userids = $vote['userids'];
        if ($bugsys->userinfo['userid'])
@@ -71,12 +71,12 @@ if ($_REQUEST['do'] == 'vote')
                        $userids = $bugsys->userinfo['userid'];
                }
        }
-       
+
        $uservote = $bugsys->input_clean('vote', TYPE_INT);
-       
+
        $votefor = $vote['votefor'];
        $voteagainst = $vote['voteagainst'];
-       
+
        if ($uservote > 0)
        {
                $votefor++;
@@ -89,7 +89,7 @@ if ($_REQUEST['do'] == 'vote')
        {
                $message->error(T('You need to specify whether you want to vote for or against this bug.'));
        }
-       
+
        $db->query("UPDATE " . TABLE_PREFIX . "vote SET userids = '$userids', votefor = $votefor, voteagainst = $voteagainst WHERE bugid = $bug[bugid]");
 
        $message->redirect(T('Your vote has been added.'), "showreport.php?bugid=$bug[bugid]");