From b6dea2e380bcb9a5cef518348cbc98c99a665b4e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 11 Apr 2020 01:28:50 -0400 Subject: [PATCH] Zap all trailing whitespace. find . -name '*.php' -exec gsed -i -E 's/\s+$//' {} \+ ; --- admin/automation.php | 64 ++++---- admin/field.php | 80 +++++----- admin/global.php | 16 +- admin/language.php | 44 +++--- admin/permission.php | 44 +++--- admin/priority.php | 32 ++-- admin/product.php | 102 ++++++------- admin/purge_inactive.php | 18 +-- admin/resolution.php | 32 ++-- admin/setting.php | 90 +++++------ admin/severity.php | 32 ++-- admin/status.php | 32 ++-- admin/user.php | 114 +++++++------- admin/usergroup.php | 100 ++++++------- admin/userhelp.php | 38 ++--- attachment.php | 70 ++++----- docs/datatools.php | 42 +++--- docs/datatools_store.php | 6 +- docs/mailtest.php | 22 +-- docs/migrate_custom_fields.php | 2 +- docs/mycookies.php | 10 +- docs/populate.php | 16 +- docs/post-commit.php | 2 +- docs/update_bug_table_cache.php | 2 +- docs/update_field_order_in_bugs.php | 2 +- editcomment.php | 24 +-- editreport.php | 44 +++--- explain.php | 32 ++-- favorite.php | 16 +- framework/api.php | 170 ++++++++++----------- framework/date.php | 32 ++-- framework/dev/conditionaltest.php | 4 +- framework/functions.php | 106 ++++++------- framework/graph_pie.php | 70 ++++----- framework/installer.php | 10 +- framework/kernel.php | 214 +++++++++++++-------------- framework/mail.php | 76 +++++----- framework/pagination.php | 88 +++++------ framework/printer.css.php | 76 +++++----- framework/printer.php | 204 ++++++++++++------------- framework/printer_css.php | 122 +++++++-------- framework/printer_navigation.php | 72 ++++----- framework/template.php | 138 ++++++++--------- framework/template_fs.php | 20 +-- framework/xml.php | 56 +++---- global.php | 8 +- includes/api_attachment.php | 8 +- includes/api_automation.php | 20 +-- includes/api_bug.php | 36 ++--- includes/api_comment.php | 16 +- includes/api_field.php | 24 +-- includes/api_language.php | 18 +-- includes/api_priority.php | 12 +- includes/api_resolution.php | 12 +- includes/api_severity.php | 12 +- includes/api_status.php | 12 +- includes/api_user.php | 62 ++++---- includes/api_usergroup.php | 14 +- includes/api_userhelp.php | 30 ++-- includes/auth/auth.php | 72 ++++----- includes/auth/auth_default.php | 20 +-- includes/auth/auth_drupal.php | 18 +-- includes/auth/auth_ipb2.php | 28 ++-- includes/auth/auth_phpbb2.php | 24 +-- includes/auth/auth_vbulletin.php | 22 +-- includes/class_admin_navigation.php | 96 ++++++------ includes/class_api_error.php | 8 +- includes/class_logging.php | 34 ++--- includes/class_message_reporter.php | 36 ++--- includes/class_mo.php | 36 ++--- includes/class_notification.php | 104 ++++++------- includes/class_sort.php | 84 +++++------ includes/functions.php | 128 ++++++++-------- includes/functions_datastore.php | 80 +++++----- includes/functions_product.php | 22 +-- includes/language.php | 10 +- index.php | 2 +- install/convert_database_charset.php | 36 ++--- install/install.php | 84 +++++------ install/upgrade.php | 18 +-- install/upgrade1.php | 4 +- install/upgrade10.php | 6 +- install/upgrade11.php | 46 +++--- install/upgrade12.php | 6 +- install/upgrade13.php | 10 +- install/upgrade14.php | 6 +- install/upgrade15.php | 6 +- install/upgrade16.php | 6 +- install/upgrade17.php | 6 +- install/upgrade18.php | 8 +- install/upgrade19.php | 6 +- install/upgrade2.php | 74 ++++----- install/upgrade3.php | 42 +++--- install/upgrade4.php | 6 +- install/upgrade5.php | 16 +- install/upgrade6.php | 6 +- install/upgrade7.php | 6 +- install/upgrade8.php | 6 +- install/upgrade9.php | 10 +- login.php | 32 ++-- newreport.php | 44 +++--- register.php | 32 ++-- search.php | 150 +++++++++---------- showreport.php | 34 ++--- syndicate.php | 8 +- userctrl.php | 44 +++--- vote.php | 18 +-- 107 files changed, 2235 insertions(+), 2235 deletions(-) diff --git a/admin/automation.php b/admin/automation.php index 491a74c..5e12226 100644 --- a/admin/automation.php +++ b/admin/automation.php @@ -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
$action[description]
", "[" . T('Edit') . "] [" . T('Delete') . "]"); } - + $admin->table_end(); - + $admin->page_end(); } diff --git a/admin/field.php b/admin/field.php index 0512bd9..f151bb1 100644 --- a/admin/field.php +++ b/admin/field.php @@ -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(); } diff --git a/admin/global.php b/admin/global.php index b49f19b..409c228 100644 --- a/admin/global.php +++ b/admin/global.php @@ -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 .= '' . T('First') . ' ...'; @@ -144,9 +144,9 @@ function AdminPageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pag { $return .= '' . T('Prev') . ' ...'; } - + $return .= $pagebits; - + if ($show['next']) { $return .= '... ' . T('Next') . ''; diff --git a/admin/language.php b/admin/language.php index e61b7ea..2d81067 100644 --- a/admin/language.php +++ b/admin/language.php @@ -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 (language_COUNTRY)'), '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 (language_COUNTRY)'), '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']) ? '' . T('DEFAULT LANGUAGE') . ' / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c' )); } - + $admin->table_end(); - + $admin->page_end(); } diff --git a/admin/permission.php b/admin/permission.php index 8a7ffdc..7d4f693 100644 --- a/admin/permission.php +++ b/admin/permission.php @@ -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'] ? "[" . T('Expand') . "]" : ''), '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 .= "[" . T('Edit') . ']'; $statuslink .= " [" . T('Revert') . ']'; } - + $admin->row_text($product['title'], $statuslink); } } } - + $admin->table_end(); - + $admin->page_end(); } diff --git a/admin/priority.php b/admin/priority.php index ef7dc6a..1619220 100644 --- a/admin/priority.php +++ b/admin/priority.php @@ -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]: $priority[priority]", "(priorityid: $priority[priorityid]) [" . T('Edit') . "] [" . T('Delete') . "]"); } $db->free_result($priorities); - + $admin->table_end(); $admin->form_end(); - + $admin->page_end(); } diff --git a/admin/product.php b/admin/product.php index 3ccb9c3..3cbfcf1 100644 --- a/admin/product.php +++ b/admin/product.php @@ -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 .= ''; } - + if ($delete) { $opt .= ''; } - + if ($addcomponent) { $opt .= ''; } - + if ($addversion) { $opt .= ''; } - + $type = strtolower($type); - + $name = $type . '_' . $id; - + $displayorder = (($displayorder != -1) ? ' ' : ''); - + return $displayorder . ' '; } @@ -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; - + $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("$product[title]", 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("-- $comp[title]", 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(); } diff --git a/admin/purge_inactive.php b/admin/purge_inactive.php index 7ea9202..dcabe42 100644 --- a/admin/purge_inactive.php +++ b/admin/purge_inactive.php @@ -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') '[' . T('Edit') . ']' => 'c' )); } - + $admin->row_tfoot('[Remove All]', 4); - + $admin->table_end(); - + $admin->page_code($pagination->constructPageNav('purge_inactive.php')); - + $admin->page_end(); } diff --git a/admin/resolution.php b/admin/resolution.php index 649a024..be452fc 100644 --- a/admin/resolution.php +++ b/admin/resolution.php @@ -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]: $resolution[resolution]", "(resolutionid: $resolution[resolutionid]) [" . T('Edit') . "] [" . T('Delete') . "]"); } $db->free_result($resolutions); - + $admin->table_end(); $admin->form_end(); - + $admin->page_end(); } diff --git a/admin/setting.php b/admin/setting.php index bae5916..c573e55 100644 --- a/admin/setting.php +++ b/admin/setting.php @@ -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 yes, 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 yes 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. Be sure that this does not end in a trailing slash ("/").
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 yes if you want to allow users to post raw HTML in their bug reports. This is very 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 Not Selected.'), 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 = ''; foreach ($bugsys->columns AS $column => $mask) { diff --git a/admin/severity.php b/admin/severity.php index 0a39dc0..66bdd81 100644 --- a/admin/severity.php +++ b/admin/severity.php @@ -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]: $severity[severity]", "(severityid: $severity[severityid]) [" . T('Edit') . "][" . T('Delete') . "]"); } $db->free_result($severities); - + $admin->table_end(); $admin->form_end(); - + $admin->page_end(); } diff --git a/admin/status.php b/admin/status.php index 5765d49..f4c56a2 100644 --- a/admin/status.php +++ b/admin/status.php @@ -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 = '
'; $admin->row_text("$colorblock$status[displayorder]: $status[status]", "(statusid: $status[statusid]) [" . T('Edit') . "][" . T('Delete') . "]"); } $db->free_result($statuses); - + $admin->table_end(); - + $admin->page_end(); } diff --git a/admin/user.php b/admin/user.php index a7d5606..e435923 100644 --- a/admin/user.php +++ b/admin/user.php @@ -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'), '
' . draw_checkbox('emailopts[0][2048]', $checked[0][2048]) . '
', 'top', 6); - + $admin->row_text(T('I am made the assignee'), '
' . draw_checkbox('emailopts[0][32]', $checked[0][32]) . '
', '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') '[' . T('Edit') . ']' => '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') '[' . T('Edit') . ']' => '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(); } diff --git a/admin/usergroup.php b/admin/usergroup.php index bbb43d2..10a2c68 100644 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -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
This is the title that others will be able to see when comments are posted.
'), '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( '' . $user['email'] . '' => 'l', bugdar::$datastore['usergroup']["$user[usergroupid]"]['title'] => 'c', - '' => 'c' + '' => '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 ? " [" . T('Delete') . "]" : '') => 'c' )); } - + $admin->table_end(); $admin->form_end(); - + $admin->page_end(); } diff --git a/admin/userhelp.php b/admin/userhelp.php index b01abe0..9d75bc7 100644 --- a/admin/userhelp.php +++ b/admin/userhelp.php @@ -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
(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 = ''; $delete = (!in_array($topic['keystring'], UserHelpAPI::not_able_to_delete()) ? '

[' . T('Delete') . ']' : ''); - + $admin->row_textarea($inputfield . '
' . $topic['keystring'] . '' . $delete, 'help[' . $topic['keystring'] . '][body]', $topic['body']); } - + $admin->row_submit(); $admin->table_end(); - + $admin->page_end(); } diff --git a/attachment.php b/attachment.php index 0b851e7..4b0e94d 100644 --- a/attachment.php +++ b/attachment.php @@ -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 .= "
in['obsoletes']) AND in_array($obsolete['attachmentid'], $bugsys->in['obsoletes']) ? ' checked="checked"' : '') . " /> $obsolete[filename]" . ($obsolete['description'] ? " [$obsolete[description]]" : '') . "
\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') . '");'); } diff --git a/docs/datatools.php b/docs/datatools.php index 738316b..a49a8ec 100644 --- a/docs/datatools.php +++ b/docs/datatools.php @@ -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 = ''; - + 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('>', '<'), $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 ''; } @@ -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; - + file_put_contents('install/settings.php', $fout); chmod('install/settings.php', 0777); - + echo 'Dumping current settings into install/settings.php'; } diff --git a/docs/datatools_store.php b/docs/datatools_store.php index 4bb738e..ef3be40 100644 --- a/docs/datatools_store.php +++ b/docs/datatools_store.php @@ -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 "hidden" 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 "Closed" 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 "Automation" 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 "0" 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 "hidden" 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 "Closed" 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 "Automation" 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 "0" 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 diff --git a/docs/mailtest.php b/docs/mailtest.php index 73cd609..92c1957 100644 --- a/docs/mailtest.php +++ b/docs/mailtest.php @@ -37,10 +37,10 @@ require_once('./global.php'); Bugdar: Mail Test - +

Mail Test

This tool will run a few email tests to make sure that emailing works. Follow the instructions below.

- +
in['__submit__']))

Email Addresses

Enter in the following email addresses for sending and receiving.

- +

Email address to receieve all tests:

An email address that exists on the mail server that is not the one receiving the tests:

@@ -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 '

You did not fill in all the fields or the email addresses are not valid. Please go back.

'; @@ -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']); - + ?>

Complete

All the test emails were sent to in['receive'] ?>. Please check that you received all 4 tests.

- + 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)) diff --git a/docs/mycookies.php b/docs/mycookies.php index 0582c1e..7d3f482 100644 --- a/docs/mycookies.php +++ b/docs/mycookies.php @@ -6,14 +6,14 @@ if (empty($_REQUEST['do'])) echo "\r"; echo '
'; echo "\r"; - + foreach ($_COOKIE AS $varname => $value) { echo "\r'; } - - echo '
NameValueDel
" . $varname . '' . $value . '
'; - + + echo ''; + echo "\r
\r"; } else @@ -22,7 +22,7 @@ else { setcookie($remove, '', time() - (2 * 900), '/'); } - + header("Location: mycookies.php"); } diff --git a/docs/populate.php b/docs/populate.php index df0c02b..b1b4c57 100644 --- a/docs/populate.php +++ b/docs/populate.php @@ -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']); diff --git a/docs/post-commit.php b/docs/post-commit.php index 47d515f..cf8bfa6 100755 --- a/docs/post-commit.php +++ b/docs/post-commit.php @@ -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); diff --git a/docs/update_bug_table_cache.php b/docs/update_bug_table_cache.php index 87a5956..e50f514 100644 --- a/docs/update_bug_table_cache.php +++ b/docs/update_bug_table_cache.php @@ -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']; } diff --git a/docs/update_field_order_in_bugs.php b/docs/update_field_order_in_bugs.php index 2f96280..0a4a6aa 100644 --- a/docs/update_field_order_in_bugs.php +++ b/docs/update_field_order_in_bugs.php @@ -13,7 +13,7 @@ $fields = array( 3 => 4, 4 => 5 ), - + 'severity' => array( 6 => 1, 1 => 2, diff --git a/editcomment.php b/editcomment.php index abef5e4..b3e21f2 100644 --- a/editcomment.php +++ b/editcomment.php @@ -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 will 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']) { diff --git a/editreport.php b/editreport.php index dd95723..d7a685c 100644 --- a/editreport.php +++ b/editreport.php @@ -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 destroy 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]"); } diff --git a/explain.php b/explain.php index 9e2b20b..9332e4c 100644 --- a/explain.php +++ b/explain.php @@ -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') . '");'); } diff --git a/favorite.php b/favorite.php index 2497297..8b043c9 100644 --- a/favorite.php +++ b/favorite.php @@ -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') . '");'); } diff --git a/framework/api.php b/framework/api.php index 26f24ac..8ae9872 100644 --- a/framework/api.php +++ b/framework/api.php @@ -27,47 +27,47 @@ */ 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; } diff --git a/framework/date.php b/framework/date.php index 3e67537..f6cdce8 100644 --- a/framework/date.php +++ b/framework/date.php @@ -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 \n\t\t\t"; foreach ((array)$this->debuginfo AS $msg) @@ -1216,7 +1216,7 @@ class ISSO $debug .= "\n\t\t\t"; } $debug .= "\n\t\t\n\t"; - + // loaded modules $modules = $this->show_modules(true); $debug .= "\n\t
  • \n\t\t\n\t
  • "; - + // template usage if ($dotemplates) { @@ -1236,12 +1236,12 @@ class ISSO } $debug .= "\n\t\t\n\t"; } - + $debug .= "\n"; - + $debug = "\n\n\n
    \n\n
    \n" . $this->message('Debug Information', $debug, 1, true, false) . "\n
    $querydebug\n\n\n"; } - + return $debug; } } diff --git a/framework/mail.php b/framework/mail.php index aa4d127..ea3b648 100644 --- a/framework/mail.php +++ b/framework/mail.php @@ -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 . '?='; } } diff --git a/framework/pagination.php b/framework/pagination.php index 937d518..d5892dd 100644 --- a/framework/pagination.php +++ b/framework/pagination.php @@ -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 .= '&'; } - + // 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); } diff --git a/framework/printer.css.php b/framework/printer.css.php index 572173d..1357a8f 100644 --- a/framework/printer.css.php +++ b/framework/printer.css.php @@ -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; } diff --git a/framework/printer.php b/framework/printer.php index 8d9b997..8283c18 100644 --- a/framework/printer.php +++ b/framework/printer.php @@ -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 ) * @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"; @@ -319,18 +319,18 @@ JS; echo $this->code; echo ($extra ? "\n$extra" : ''); echo "\n\n\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"; } - + // ################################################################### /** * Imbeds actual CSS information into the page in "; } - + // ################################################################### /** * 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 : "
    $message
    "), ':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("
    $message
    ", ':swap:', 'left', 1); $this->row_submit('', 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
    \n

    \n\t" . $this->registry->getApplication() . ' ' . $this->registry->getAppVersion() . ", ©2002 - " . date('Y') . " Blue Static\n

    "; - + if (!defined('ISSO_PRINTER_HIDE_SETUP')) { echo "\n$copyright"; echo $this->registry->construct_debug_block(false); } - + echo "\n\n\n"; - + exit; } - + // ------------------------------------------------------------------- - + // ################################################################### /** * Opens a tag with styling @@ -498,10 +498,10 @@ JS; { echo '
    '; } - + echo "\n
    \n"; } - + // ################################################################### /** * Adds a table row that is sued to head the entire table @@ -516,7 +516,7 @@ JS; { echo "\n\t\n\n"; } - + // ################################################################### /** * Creates column headings; useful for a grid-style page. This uses a @@ -532,18 +532,18 @@ JS; if (is_array($columnarray)) { $render = "\n"; - + foreach ($columnarray AS $header) { $render .= "\t\n"; } - + $render .= "\n"; - + echo $render; } } - + // ################################################################### /** * Closes a
    " . (($strong) ? "$title" : $title) . "
    $header
    tag @@ -554,9 +554,9 @@ JS; { echo "\n
    \n"; } - + // ------------------------------------------------------------------- - + // ################################################################### /** * Starts a
    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\n\n"; - + if ($do !== null) { $this->form_hidden_field('do', $do); } } - + // ################################################################### /** * Adds a hidden field at the current location @@ -592,7 +592,7 @@ JS; { echo "\n"; } - + // ################################################################### /** * Closes a tag @@ -603,9 +603,9 @@ JS; { echo "
    \n\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\n\t$text\n"; } - + // ################################################################### /** * 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 ""; - + 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\tregistry->modules['functions']->bgcolour}\" align=\"$align\">$value"; } } - + echo "\n\n"; } - + // ################################################################### /** * Generic row creation function that has two columns: label and value; @@ -705,7 +705,7 @@ JS; function row_text($label, $value = ' ', $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 ""; echo "\n\t$label"; echo "\n\t$value"; - + echo "\n\n"; } - + // ################################################################### /** * Creates a table row with an text field as the value column @@ -749,7 +749,7 @@ JS; { $this->row_text($label, "", $lalign, $colspan); } - + // ################################################################### /** * Creates a table row with a ", '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"; $output .= ($reset ? "\n\t\t" : ''); $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, "", '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 $optionlist\n" . (($is_jump) ? "\n" : '') . "\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 $box[name]"; } - + $listitem = array(); - + $this->row_text($label, "\n" . implode('
    ', $optionlist) . "\n", $colspan); } - + // ################################################################### /** * Creates a row with two radio buttons: yes and now diff --git a/framework/printer_css.php b/framework/printer_css.php index be1c1c7..777dce0 100644 --- a/framework/printer_css.php +++ b/framework/printer_css.php @@ -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 = " @@ -258,7 +258,7 @@ class Printer_CSS - +
    $lang[standard_css_attributes] - + @@ -283,7 +283,7 @@ class Printer_CSS
    " . $this->fetch_modified_link($desc, 'background', $lang['background']) . "
    " . $this->fetch_modified_link($desc, 'extra', $lang['extra_css_attributes']) . " @@ -302,7 +302,7 @@ class Printer_CSS $status["{$selname}_{$name}"] = $this->fetch_modified_status($descriptor['descriptor'] . ' ' . $sel, $prop); } } - + $html .= " @@ -310,7 +310,7 @@ class Printer_CSS - + - + "; } - + 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); } } diff --git a/includes/functions.php b/includes/functions.php index b265377..10fd598 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -39,12 +39,12 @@ 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; } diff --git a/includes/functions_datastore.php b/includes/functions_datastore.php index 74ca7b3..e5e4536 100644 --- a/includes/functions_datastore.php +++ b/includes/functions_datastore.php @@ -23,13 +23,13 @@ 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; } diff --git a/includes/functions_product.php b/includes/functions_product.php index 3779ea4..ac263ad 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -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; } diff --git a/includes/language.php b/includes/language.php index e5a17c2..c45f80d 100644 --- a/includes/language.php +++ b/includes/language.php @@ -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'; diff --git a/index.php b/index.php index f882ca0..a25289c 100644 --- 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); } diff --git a/install/convert_database_charset.php b/install/convert_database_charset.php index a694d19..d487f53 100644 --- a/install/convert_database_charset.php +++ b/install/convert_database_charset.php @@ -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"; @@ -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 '

    Convert Database Character Set

    '; echo '

    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 ' . TARGET . '. This script can migrate all of data from your current character set/collation of ' . $collation['Value'] . '. If you would like to convert your database to utf8, please click the link below.

    '; - + echo '

    Please back up your database before continuing! While this script is tested and should be safe, it is better to be cautious.

    '; - + PrintContinue(1); } @@ -73,11 +73,11 @@ else if ($bugsys->in['step'] == 1) { echo '

    Preserve Existing Data

    '; echo '

    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.

    '; - + $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 '

    Convert Database Character Set

    '; echo '

    This step changes the database\'s character set.

    '; - + require './includes/config.php'; $db->query("ALTER DATABASE $database COLLATE " . TARGET); echo '

    Convert Table Character Set

    '; echo '

    This converts each table\'s character set and collation.

    '; - + $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 '

    Convert Table Columns

    '; echo '

    This converts all the table columns that are stored with a character set.

    '; - + $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); } diff --git a/install/install.php b/install/install.php index 9c727ad..13a4cc8 100644 --- a/install/install.php +++ b/install/install.php @@ -70,41 +70,41 @@ if ($bugsys->in['mark'] == 1) MySQL Privileges:
      showerrors = false; - + $pf = $tests[] = ($db->query("CREATE TABLE install_check (col1 VARCHAR(255) NULL);") ? 'pass' : 'fail'); echo "\n\t
    • CREATE TABLE
    • "; - + $pf = $tests[] = ($db->query("INSERT INTO install_check (col1) VALUES ('example')") ? 'pass' : 'fail'); echo "\n\t
    • INSERT
    • "; - + $pf = $tests[] = ($db->query("UPDATE install_check SET col1 = 'example2'") ? 'pass' : 'fail'); echo "\n\t
    • UPDATE
    • "; - + $pf = $tests[] = ($db->query("SELECT * FROM install_check") ? 'pass' : 'fail'); echo "\n\t
    • SELECT
    • "; - + $pf = $tests[] = ($db->query("DELETE FROM install_check WHERE col1 = 'example2'") ? 'pass' : 'fail'); echo "\n\t
    • DELETE
    • "; - + $pf = $tests[] = ($db->query("ALTER TABLE install_check ADD col3 BOOL") ? 'pass' : 'fail'); echo "\n\t
    • ALTER
    • "; - + $pf = $tests[] = ($db->query("ALTER TABLE install_check ADD INDEX (col1)") ? 'pass' : 'fail'); echo "\n\t
    • ALTER ADD INDEX
    • "; - + $pf = $tests[] = ($db->query("REPLACE INTO install_check (col1) VALUES ('example3')") ? 'pass' : 'fail'); echo "\n\t
    • REPLACE
    • "; - + $pf = $tests[] = ($db->query("OPTIMIZE TABLE install_check") ? 'pass' : 'fail'); echo "\n\t
    • OPTIMIZE
    • "; - + $pf = $tests[] = ($db->query("DROP TABLE install_check") ? 'pass' : 'fail'); echo "\n\t
    • DROP TABLE
    • "; - + echo "\n
    "; - + $valcount = array_count_values($tests); if ($valcount['fail'] > 0) { @@ -123,12 +123,12 @@ if ($bugsys->in['mark'] == 2)

    This step will load the tables into your database so the rest of the installation can proceed forward.

    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)

    Default table data for usergroups, statuses, priorities, and other various options are being loaded. This will allow you to use Bugdar with minimal setup.

    $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 . '
    ' . "\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
    ' . "\n"; } @@ -180,14 +180,14 @@ if ($bugsys->in['mark'] == 4)

    Default settings are being loaded into the system.

    $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)

    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.

    \n"; - + build_usergroups(); echo "Cached usergroups
    \n"; - + build_statuses(); echo "Cached statuses
    \n"; - + build_priorities(); echo "Cached priorities
    \n"; - + build_severities(); echo "Cached severities
    \n"; - + build_assignedto(); echo "Cached assignable users/developers
    \n"; - + build_resolutions(); echo "Cached resolutions
    \n"; - + build_products(); echo "Cached products
    \n"; - + build_versions(); echo "Cached versions
    \n"; - + build_languages(); echo "Cached languages
    \n"; - + build_user_help(); echo "Cached user help documentation
    \n"; } @@ -284,13 +284,13 @@ if ($bugsys->in['mark'] == 7) 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)

    Your new user has been added.

    set('email', $bugsys->in['email']); $user->set('displayname', $bugsys->in['displayname']); diff --git a/install/upgrade.php b/install/upgrade.php index 8f01d95..70f33a1 100644 --- a/install/upgrade.php +++ b/install/upgrade.php @@ -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 "

    Bugdar Upgrade System

    \n\n"; - + echo "

    Your Bugdar installation is up-to-date!

    \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"); } diff --git a/install/upgrade1.php b/install/upgrade1.php index 248f0d7..cd1e0c1 100644 --- a/install/upgrade1.php +++ b/install/upgrade1.php @@ -51,9 +51,9 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.0.1' WHERE varname = 'trackerversion'"); - + build_settings(); ?> diff --git a/install/upgrade10.php b/install/upgrade10.php index b7c4121..e3544d5 100644 --- a/install/upgrade10.php +++ b/install/upgrade10.php @@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.5' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade11.php b/install/upgrade11.php index ef3e636..fc8d55a 100644 --- a/install/upgrade11.php +++ b/install/upgrade11.php @@ -49,22 +49,22 @@ if ($bugsys->in['mark'] == 1)

    There are a few minor changes made to Bugdar's database schema that need to be propagated.

    query("ALTER TABLE " . TABLE_PREFIX . "comment ADD parselinks BOOL NULL"); echo "Adding comment.parselinks to add an option to parse links in comments
    \n"; - + $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD columnoptions TEXT NULL"); echo "Adding user.columnoptions to allow for custom column sorting
    \n"; $db->query("ALTER TABLE " . TABLE_PREFIX . "product CHANGE componentmother parentid INT UNSIGNED NULL"); echo "Renaming product.componentmother to product.parentid
    \n"; - + $db->query("ALTER TABLE " . TABLE_PREFIX . "version ADD obsolete BOOL NULL"); echo "Adding version.obsolete so products cannot be filed against certain versions
    \n"; - + $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD authid VARCHAR(255) NULL"); echo "Adding user.authid for the Authentication API
    \n"; - + echo "... done
    \n"; } @@ -77,19 +77,19 @@ if ($bugsys->in['mark'] == 2)

    To support saved searches, a few major modifications need to be performed on the search table.

    query("ALTER TABLE " . TABLE_PREFIX . "search DROP PRIMARY KEY"); echo "Dropping current primary key
    \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
    \n"; - + $db->query("ALTER TABLE " . TABLE_PREFIX . "search ADD name VARCHAR(250) NULL"); echo "Adding search.name to allow naming of searches
    \n"; - + $db->query("DELETE FROM " . TABLE_PREFIX . "search"); echo "Clearing out all the old searches
    \n"; - + echo "... done
    \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
    \n"; } - + echo ".... all done
    \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
    "; - + $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
    \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
    \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
    \n"; - + echo "... done
    \n"; } @@ -183,15 +183,15 @@ if ($bugsys->in['mark'] == 5)

    This step finishes the upgrade by inreasing your version number.

    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 "0" 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. diff --git a/install/upgrade12.php b/install/upgrade12.php index a49b329..9298ceb 100644 --- a/install/upgrade12.php +++ b/install/upgrade12.php @@ -63,11 +63,11 @@ if ($bugsys->in['mark'] == 2)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0 Beta 2' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade13.php b/install/upgrade13.php index c6c4b93..0c17cc1 100644 --- a/install/upgrade13.php +++ b/install/upgrade13.php @@ -56,7 +56,7 @@ if ($bugsys->in['mark'] == 1) $db->query("ALTER TABLE " . TABLE_PREFIX . "user ADD groupids TEXT NULL"); echo "Adding user.groupids
    \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)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0 Beta 3' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade14.php b/install/upgrade14.php index bf825ca..69d2da5 100644 --- a/install/upgrade14.php +++ b/install/upgrade14.php @@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0 Release Candidate 1' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade15.php b/install/upgrade15.php index f0a45d5..0b422c9 100644 --- a/install/upgrade15.php +++ b/install/upgrade15.php @@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.0' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade16.php b/install/upgrade16.php index 1d56268..0a0cf63 100644 --- a/install/upgrade16.php +++ b/install/upgrade16.php @@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.1' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade17.php b/install/upgrade17.php index 85f68df..4d7233c 100644 --- a/install/upgrade17.php +++ b/install/upgrade17.php @@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.2' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade18.php b/install/upgrade18.php index bc55e38..1a9ad51 100644 --- a/install/upgrade18.php +++ b/install/upgrade18.php @@ -49,7 +49,7 @@ if ($bugsys->in['mark'] == 1)

    Making minor schema changes so that permission mask fields are large enough for the high integer values.

    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)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.3' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade19.php b/install/upgrade19.php index 165b1af..556e0b7 100644 --- a/install/upgrade19.php +++ b/install/upgrade19.php @@ -50,11 +50,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.2.4' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade2.php b/install/upgrade2.php index 66aea3b..f993537 100644 --- a/install/upgrade2.php +++ b/install/upgrade2.php @@ -47,10 +47,10 @@ if ($bugsys->in['mark'] == 1) { ?>

    Major Table Changes

    - +

    Major table additions and deletions are being performed on your database.

    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
    \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)
    \n"; } @@ -73,21 +73,21 @@ if ($bugsys->in['mark'] == 2) { ?>

    User Table Changes

    - +

    Changes are now being done on the user table.

    query("ALTER TABLE " . TABLE_PREFIX . "user ADD usedst BOOL NOT NULL"); - + echo "Adding user.usedst, a daylight savings time option
    \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
    \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
    \n"; } @@ -97,28 +97,28 @@ if ($bugsys->in['mark'] == 3) { ?>

    Minor Table Changes

    - +

    Minor, miscellaneous modifications are now being performed on database tables.

    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
    \n"; $db->query("ALTER TABLE " . TABLE_PREFIX . "search ADD resultcount INT(10) NULL"); - + echo "Adding search.resultcount as an internal counter for search features
    \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
    \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
    \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
    \n"; } @@ -128,25 +128,25 @@ if ($bugsys->in['mark'] == 4) { ?>

    Caching User Data in Bug Table

    - +

    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.

    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
    \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
    \n"; } @@ -169,12 +169,12 @@ if ($bugsys->in['mark'] == 5) { ?>

    Updating Old History Items

    - +

    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.

    query("SELECT * FROM " . TABLE_PREFIX . "history"); while ($log = $db->fetch_array($history)) { @@ -208,7 +208,7 @@ if ($bugsys->in['mark'] == 5) } echo "."; } - + echo " done
    \n"; } @@ -221,9 +221,9 @@ if ($bugsys->in['mark'] == 6)

    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.

    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
    \n"; } @@ -255,18 +255,18 @@ if ($bugsys->in['mark'] == 7)

    This step finishes the upgrade by inreasing your version number and then updating other settings.

    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. diff --git a/install/upgrade3.php b/install/upgrade3.php index 956251f..0eefb99 100644 --- a/install/upgrade3.php +++ b/install/upgrade3.php @@ -47,28 +47,28 @@ if ($bugsys->in['mark'] == 1) { ?>

    Language System Updates

    - +

    In Bugdar 1.1.0 Beta 2, the language system was changed to use Gettext. These schema changes reflect that change.

    query("DROP TABLE " . TABLE_PREFIX . "localization"); - + echo "Dropping the strings cache table
    \n"; - + $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP filename"); - + echo "Dropping language.filename
    \n"; - + $db->query("ALTER TABLE " . TABLE_PREFIX . "language CHANGE languagecode langcode VARCHAR(5) NOT NULL"); - + echo "Adding language.langcode for the Gettext language code
    \n"; - + $db->query("ALTER TABLE " . TABLE_PREFIX . "language DROP debug"); - + echo "Dropping language.debug as language debug mode no longer exists
    \n"; - + $db->query("UPDATE " . TABLE_PREFIX . "language SET langcode = 'en_US' WHERE languageid = 1"); - + echo "Setting the correct langcode for English (US)
    \n"; } @@ -78,16 +78,16 @@ if ($bugsys->in['mark'] == 2) { ?>

    English US Changes

    - +

    These changes bring the schema into English (US) compliance.

    query("ALTER TABLE " . TABLE_PREFIX . "favourite RENAME " . TABLE_PREFIX . "favorite"); - + echo "Renaming table 'favourite' to 'favorite'
    \n"; $db->query("ALTER TABLE " . TABLE_PREFIX . "user CHANGE showcolours showcolors BOOL NULL"); - + echo "Renaming user.showcolours to user.showcolors
    \n"; } @@ -97,12 +97,12 @@ if ($bugsys->in['mark'] == 3) { ?>

    Adding New Permission Mask

    - +

    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.

    query("UPDATE " . TABLE_PREFIX . "usergroup SET permissions = permissions + 33554432 WHERE usergroupid IN (2, 5, 6)"); - + echo "Increased permission levels
    \n"; } @@ -116,11 +116,11 @@ if ($bugsys->in['mark'] == 4)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0 Beta 2' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade4.php b/install/upgrade4.php index d66dd63..300ca39 100644 --- a/install/upgrade4.php +++ b/install/upgrade4.php @@ -51,11 +51,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0 Release Candidate 1' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade5.php b/install/upgrade5.php index 902f94c..4ac551f 100644 --- a/install/upgrade5.php +++ b/install/upgrade5.php @@ -48,19 +48,19 @@ if ($bugsys->in['mark'] == 1) { ?>

    Rename Automatic Actions

    - +

    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.

    query("ALTER TABLE " . TABLE_PREFIX . "autoaction RENAME " . TABLE_PREFIX . "automation"); echo "Renaming datbase table
    \n"; - + $db->query("DELETE FROM " . TABLE_PREFIX . "datastore WHERE title = 'autoaction'"); echo "Clearing old datastore information
    \n"; - + build_automations(); echo "Rebuilding the automations cahce
    \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)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.0' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade6.php b/install/upgrade6.php index 53dab2f..22acfa4 100644 --- a/install/upgrade6.php +++ b/install/upgrade6.php @@ -52,11 +52,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.1' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade7.php b/install/upgrade7.php index e691ce1..90b58c4 100644 --- a/install/upgrade7.php +++ b/install/upgrade7.php @@ -52,11 +52,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.2' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade8.php b/install/upgrade8.php index 7d88cbd..b2ae7e6 100644 --- a/install/upgrade8.php +++ b/install/upgrade8.php @@ -52,11 +52,11 @@ if ($bugsys->in['mark'] == 1)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.3' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/install/upgrade9.php b/install/upgrade9.php index 973c868..20b09af 100644 --- a/install/upgrade9.php +++ b/install/upgrade9.php @@ -49,9 +49,9 @@ if ($bugsys->in['mark'] == 1)

    Changing the storage type of the time zone field from INT to FLOAT to fix a bug.

    query("ALTER TABLE " . TABLE_PREFIX . "user CHANGE timezone timezone float(4) NOT NULL DEFAULT 0"); - + echo "... done
    \n"; } @@ -65,11 +65,11 @@ if ($bugsys->in['mark'] == 2)

    This step finishes the upgrade by inreasing your version number.

    query("UPDATE " . TABLE_PREFIX . "setting SET value = '1.1.4' WHERE varname = 'trackerversion'"); - + build_settings(); - + ?> ... done. diff --git a/login.php b/login.php index 92f9f5d..95c9fdf 100644 --- 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') . '");'); } diff --git a/newreport.php b/newreport.php index 72e193f..f66f265 100644 --- a/newreport.php +++ b/newreport.php @@ -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') . '");'); } diff --git a/register.php b/register.php index 84e17c8..766e153 100644 --- a/register.php +++ b/register.php @@ -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 diff --git a/search.php b/search.php index 4c71934..d04b40b 100644 --- a/search.php +++ b/search.php @@ -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 try again 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 here and try again.')); } - + if (!$search) { $message->error(T('Your search has expired because it is older than one hour. Please start over here.')); } - + $bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($search[ids]) $search[orderby]"); - + $xml = ''; @@ -599,9 +599,9 @@ if ($_REQUEST['do'] == 'export') while ($bug = $db->fetch_array($bugs)) { $xml .= "\n\t"; - + $bug = ProcessBugDataForDisplay($bug); - + $xml .= "\n\t\t" . $bug['bugid'] . ""; $xml .= "\n\t\t" . $datef->format('r', $bug['dateline']) . ""; if ($bug['userid']) @@ -623,12 +623,12 @@ if ($_REQUEST['do'] == 'export') $xml .= "\n\t\t" . $bug['resolution'] . ""; $xml .= "\n\t\t" . $bug['severity'] . ""; $xml .= "\n\t\t" . $bug['priority'] . ""; - + $xml .= "\n\t"; } - + $xml .= "\n"; - + $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 try again 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, "&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') . '");'); } diff --git a/showreport.php b/showreport.php index b3cd705..da3fbbb 100644 --- a/showreport.php +++ b/showreport.php @@ -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[] = "$duplicate[summary]"; } $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) { diff --git a/syndicate.php b/syndicate.php index cd9ff6f..cfa31c9 100644 --- a/syndicate.php +++ b/syndicate.php @@ -78,13 +78,13 @@ while ($bug = $db->fetch_array($bugs_fetch))
    $lang[links_normal] - + @@ -327,11 +327,11 @@ class Printer_CSS
    " . $this->fetch_modified_link($desc . ' a:link', 'background', $lang['background']) . "
    $lang[links_visited] - + @@ -348,11 +348,11 @@ class Printer_CSS
    " . $this->fetch_modified_link($desc . ' a:visited', 'background', $lang['background']) . "
    $lang[links_hover] - + @@ -372,17 +372,17 @@ class Printer_CSS
    " . $this->fetch_modified_link($desc . ' a:hover', 'background', $lang['background']) . "
    "; } - + $print->row_span($html, 'alt2', 'left', 1); - + $print->row_span('
    ' . $lang['css_selector'] . ': ' . $descriptor['descriptor'] . '
    ', '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('"', '"', "\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; } } diff --git a/framework/printer_navigation.php b/framework/printer_navigation.php index b0e018a..ce60c80 100644 --- a/framework/printer_navigation.php +++ b/framework/printer_navigation.php @@ -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 = '' . "\n\n"; - + // ------------------------------------------------------------------- - + $output2 = array(); foreach ($this->toplinks AS $href => $text) { $output2[] = '' . $text . ''; } - + $language = $this->registry->modules['printer']->getLanguageInformation(); - + $output .= "\n" . ''; - + // ------------------------------------------------------------------- - + $output .= "\n\n" . '
    '; - + // ------------------------------------------------------------------- - + $output .= "\n" . '
    '; foreach ($this->tabs AS $key => $content) { @@ -237,20 +237,20 @@ class Printer_Navigation { $link .= ' id="focustab"'; } - + $link .= '>' . $content[0] . ''; - + $output .= $link; } $output .= "\n" . '
    '; - + // ------------------------------------------------------------------- - + $output .= "\n\n" . ''; $output .= "\n" . ''; - + // ------------------------------------------------------------------- - + $output .= "\n" . ''; - + // ------------------------------------------------------------------- - + $output .= "\n" . ''; $output .= "\n" . ''; - + $output .= "\n\n" . '
    '; $output .= "\n\n" . '' . "\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" . '' . "\n"; - + $output .= "\n" . '
    '; - + $output .= "\n\n" . '
    '; - + return $output; } } diff --git a/framework/template.php b/framework/template.php index 4c6fbad..90f6103 100644 --- a/framework/template.php +++ b/framework/template.php @@ -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('', $this->registry->construct_debug_block(true) . '', $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 = ' $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('#(.*?)#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 = ''; $tag_end = ''; - + // 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 $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(); diff --git a/framework/template_fs.php b/framework/template_fs.php index 9923893..946feab 100644 --- a/framework/template_fs.php +++ b/framework/template_fs.php @@ -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 diff --git a/framework/xml.php b/framework/xml.php index f088b5e..8141a77 100644 --- a/framework/xml.php +++ b/framework/xml.php @@ -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 diff --git a/global.php b/global.php index da0dbff..5541663 100644 --- a/global.php +++ b/global.php @@ -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') . '";'); diff --git a/includes/api_attachment.php b/includes/api_attachment.php index 52f76f1..51774de 100644 --- a/includes/api_attachment.php +++ b/includes/api_attachment.php @@ -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 diff --git a/includes/api_automation.php b/includes/api_automation.php index 651da48..7b7850f 100644 --- a/includes/api_automation.php +++ b/includes/api_automation.php @@ -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; } } diff --git a/includes/api_bug.php b/includes/api_bug.php index 0757fb3..4d8f905 100644 --- a/includes/api_bug.php +++ b/includes/api_bug.php @@ -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 diff --git a/includes/api_comment.php b/includes/api_comment.php index 9e9a05e..09f3269 100644 --- a/includes/api_comment.php +++ b/includes/api_comment.php @@ -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', 'bug \3', $comment); $comment = preg_replace('#(https?://|www\.)\S+#i', '\0', $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 diff --git a/includes/api_field.php b/includes/api_field.php index 1fdbc06..b927f21 100644 --- a/includes/api_field.php +++ b/includes/api_field.php @@ -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; } } diff --git a/includes/api_language.php b/includes/api_language.php index ace116b..f03d1ce 100644 --- a/includes/api_language.php +++ b/includes/api_language.php @@ -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 diff --git a/includes/api_priority.php b/includes/api_priority.php index 216f4f8..2027003 100644 --- a/includes/api_priority.php +++ b/includes/api_priority.php @@ -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 diff --git a/includes/api_resolution.php b/includes/api_resolution.php index ada17fe..a90f90b 100644 --- a/includes/api_resolution.php +++ b/includes/api_resolution.php @@ -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 diff --git a/includes/api_severity.php b/includes/api_severity.php index 01a4a54..f2f773d 100644 --- a/includes/api_severity.php +++ b/includes/api_severity.php @@ -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 diff --git a/includes/api_status.php b/includes/api_status.php index 898f6dc..609321b 100644 --- a/includes/api_status.php +++ b/includes/api_status.php @@ -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 diff --git a/includes/api_user.php b/includes/api_user.php index 9f31637..6ade4a2 100644 --- a/includes/api_user.php +++ b/includes/api_user.php @@ -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 diff --git a/includes/api_usergroup.php b/includes/api_usergroup.php index 5b8093a..cca65a6 100644 --- a/includes/api_usergroup.php +++ b/includes/api_usergroup.php @@ -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 diff --git a/includes/api_userhelp.php b/includes/api_userhelp.php index 315acba..739e9a8 100644 --- a/includes/api_userhelp.php +++ b/includes/api_userhelp.php @@ -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; } } diff --git a/includes/auth/auth.php b/includes/auth/auth.php index ace39cb..367e13e 100644 --- a/includes/auth/auth.php +++ b/includes/auth/auth.php @@ -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 diff --git a/includes/auth/auth_default.php b/includes/auth/auth_default.php index 693b98c..ed171d2 100644 --- a/includes/auth/auth_default.php +++ b/includes/auth/auth_default.php @@ -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() {} } diff --git a/includes/auth/auth_drupal.php b/includes/auth/auth_drupal.php index c834f08..95c8767 100644 --- a/includes/auth/auth_drupal.php +++ b/includes/auth/auth_drupal.php @@ -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) { diff --git a/includes/auth/auth_ipb2.php b/includes/auth/auth_ipb2.php index 156b08a..7628127 100644 --- a/includes/auth/auth_ipb2.php +++ b/includes/auth/auth_ipb2.php @@ -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'); } } diff --git a/includes/auth/auth_phpbb2.php b/includes/auth/auth_phpbb2.php index 7d4a115..1dce1c9 100644 --- a/includes/auth/auth_phpbb2.php +++ b/includes/auth/auth_phpbb2.php @@ -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']); } } diff --git a/includes/auth/auth_vbulletin.php b/includes/auth/auth_vbulletin.php index c1d7555..86ac6be 100644 --- a/includes/auth/auth_vbulletin.php +++ b/includes/auth/auth_vbulletin.php @@ -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) { diff --git a/includes/class_admin_navigation.php b/includes/class_admin_navigation.php index eef6d50..8d7105d 100644 --- a/includes/class_admin_navigation.php +++ b/includes/class_admin_navigation.php @@ -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&languageid=' . $id); $navigator->add_component('link', 'options-languages-delete', 'options-languages', T('Delete'), 'language.php?do=delete&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&productid=' . $id); $navigator->add_component('link', 'products-edit-version', 'products-edit', T('Add New Version'), 'product.php?do=addversion&productid=' . $id); $navigator->add_component('link', 'products-edit-delete', 'products-edit', T('Delete Product'), 'product.php?do=deleteproduct&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&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&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&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&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&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&actionid=' . $id); } - + // ################################################################### /** * User tab pages @@ -337,14 +337,14 @@ class NavLinks function usersPages() { global $navigator; - + $navigator->add_component('section', 'users-pages', 'users', T('Users & 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&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&userid=' . $id); } diff --git a/includes/class_api_error.php b/includes/class_api_error.php index 34e9286..439b5a2 100644 --- a/includes/class_api_error.php +++ b/includes/class_api_error.php @@ -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 diff --git a/includes/class_logging.php b/includes/class_logging.php index 7cb9b3e..1365ed4 100644 --- a/includes/class_logging.php +++ b/includes/class_logging.php @@ -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 diff --git a/includes/class_message_reporter.php b/includes/class_message_reporter.php index 6962c14..212735b 100644 --- a/includes/class_message_reporter.php +++ b/includes/class_message_reporter.php @@ -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
      "; foreach ($this->errors AS $err) { $this->errorBox .= "\n\t
    1. " . $err . "
    2. "; } $this->errorBox .= "\n
    "; - + 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 @@ -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 .= '' . "\n"; } - + eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");'); exit; } diff --git a/includes/class_mo.php b/includes/class_mo.php index 6ffcb0a..1a8a3b0 100644 --- a/includes/class_mo.php +++ b/includes/class_mo.php @@ -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); } } diff --git a/includes/class_notification.php b/includes/class_notification.php index 1457b3b..0ad92dd 100644 --- a/includes/class_notification.php +++ b/includes/class_notification.php @@ -22,14 +22,14 @@ /** * 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 diff --git a/includes/class_sort.php b/includes/class_sort.php index d0de4c4..af05e61 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -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 tag for the sort arrow @@ -290,7 +290,7 @@ class ListSorter { return ''; } - + // ################################################################### /** * Returns the href value for an tag by generating all the necessary @@ -310,10 +310,10 @@ class ListSorter { $params .= '&'; } - + return $this->page . '.php?' . $params . 'by=' . $key . '&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
    $data ' . T('Severity') . ': ' . bugdar::$datastore['severity']["$bug[severity]"]['severity'] . '
    - +

    ' . $bug['comment_parsed'] . '

    ') . ' ' . htmlspecialchars($bug['comment_parsed']) . ' '; - + $lastupdated = $bug["$timestamp"]; } @@ -94,12 +94,12 @@ echo ' ' . sprintf(T('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . ' ' . gmdate('Y-m-d\TH:i:s\Z', $lastupdated) . ' - + '; echo $syndicate; - + echo ' diff --git a/userctrl.php b/userctrl.php index a6cb70d..566e155 100644 --- a/userctrl.php +++ b/userctrl.php @@ -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') . '");'); } diff --git a/vote.php b/vote.php index 6165703..2507b35 100644 --- 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]"); -- 2.22.5