session_start(); if (isset($_SESSION['username'])) { echo "you logged in as </br>", $_SESSION['username']; } else { //your page stuff } // Require db connection and auth class require "includes/config.php"; require "includes/authenticate.php"; // $user = Auth(); $user = new Auth(); $error = ''; // If user has session he does not have to login again if (isset($_SESSION["username"])) { $user->redirect('upload.php'); } /*if(isset($_SESSION["username"])){ echo "<a href='logout.php'>Logout takkii</a>"; }*/ include './includes/title.php'; ?> <!DOCTYPE html> <?php include "./includes/head.php"; ?> <body> <?php include "./includes/header.php"; include "./includes/menu.php";
// | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation; either version 2 of the License, or | // | (at your option) any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 59 Temple Place - Suite 330 | // | Boston, MA 02111-1307, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ // // @(#) $Id: s.index.php 1.1 03/09/16 23:01:42-00:00 jpradomaia $ // include_once "../config.inc.php"; include_once APP_INC_PATH . "class.template.php"; include_once APP_INC_PATH . "db_access.php"; Auth::checkAuthentication(APP_COOKIE); if (Auth::getCurrentRole() <= User::getRoleID("Customer")) { Auth::redirect("../main.php"); } $tpl = new Template_API(); $tpl->setTemplate("reports/index.tpl.html"); $tpl->displayTemplate();
// only list those projects that are allowing anonymous reporting of new issues $projects = Project::getAnonymousList(); if (empty($projects)) { $tpl->assign('no_projects', '1'); } else { if (!in_array($_GET['project'], array_keys($projects))) { $tpl->assign('no_projects', '1'); } else { // get list of custom fields for the selected project $options = Project::getAnonymousPostOptions($_GET['project']); if (@$options['show_custom_fields'] == 'yes') { $tpl->assign('custom_fields', Custom_Field::getListByProject($_GET['project'], 'anonymous_form')); } $tpl->assign('project_name', Project::getName($_GET['project'])); } } } else { // only list those projects that are allowing anonymous reporting of new issues $projects = Project::getAnonymousList(); if (empty($projects)) { $tpl->assign('no_projects', '1'); } else { if (count($projects) == 1) { $project_ids = array_keys($projects); Auth::redirect('post.php?post_form=yes&project=' . $project_ids[0]); } else { $tpl->assign('projects', $projects); } } } $tpl->displayTemplate();
/** * Method used to get the list of issues to be displayed in the grid layout. * * @param integer $prj_id The current project ID * @param array $options The search parameters * @param integer $current_row The current page number * @param integer $max The maximum number of rows per page. 'ALL' for unlimited. * @return array The list of issues to be displayed */ public static function getListing($prj_id, $options, $current_row = 0, $max = 5) { if (strtoupper($max) == 'ALL') { $max = 9999999; } $start = $current_row * $max; // get the current user's role $usr_id = Auth::getUserID(); $role_id = User::getRoleByUser($usr_id, $prj_id); $usr_details = User::getDetails($usr_id); // get any custom fields that should be displayed $custom_fields = Custom_Field::getFieldsToBeListed($prj_id); $stmt = 'SELECT iss_id, iss_grp_id, iss_prj_id, iss_sta_id, iss_customer_id, iss_customer_contract_id, iss_created_date, iss_updated_date, iss_last_response_date, iss_closed_date, iss_last_customer_action_date, iss_usr_id, iss_summary, pri_title, prc_title, sta_title, sta_color status_color, sta_id, iqu_status, grp_name, pre_title, iss_last_public_action_date, iss_last_public_action_type, iss_last_internal_action_date, iss_last_internal_action_type, ' . Issue::getLastActionFields() . ",\n CASE WHEN iss_last_internal_action_date > iss_last_public_action_date THEN 'internal' ELSE 'public' END AS action_type,\n iss_private,\n usr_full_name,\n iss_percent_complete,\n iss_dev_time,\n iss_expected_resolution_date,\n sev_title\n FROM\n (\n {{%issue}},\n {{%user}}"; // join custom fields if we are searching by custom fields if (is_array($options['custom_field']) && count($options['custom_field']) > 0) { foreach ($options['custom_field'] as $fld_id => $search_value) { if (empty($search_value)) { continue; } $field = Custom_Field::getDetails($fld_id); if ($field['fld_type'] == 'date' && (empty($search_value['Year']) || empty($search_value['Month']) || empty($search_value['Day']))) { continue; } if ($field['fld_type'] == 'integer' && empty($search_value['value'])) { continue; } if ($field['fld_type'] == 'multiple') { $search_value = Misc::escapeString($search_value); foreach ($search_value as $cfo_id) { $stmt .= ",\n{{%issue_custom_field}} as cf" . $fld_id . '_' . $cfo_id . "\n"; } } else { $stmt .= ",\n{{%issue_custom_field}} as cf" . $fld_id . "\n"; } } } $stmt .= ')'; // check for the custom fields we want to sort by if (strstr($options['sort_by'], 'custom_field') !== false) { $fld_id = str_replace('custom_field_', '', $options['sort_by']); $stmt .= "\n LEFT JOIN \n\n {{%issue_custom_field}} as cf_sort\n ON\n (cf_sort.icf_iss_id = iss_id AND cf_sort.icf_fld_id = {$fld_id}) \n"; } if (!empty($options['users']) || $options['sort_by'] === 'isu_usr_id') { $stmt .= ' LEFT JOIN {{%issue_user}} ON isu_iss_id=iss_id'; } if (!empty($usr_details['usr_par_code'])) { // restrict partners $stmt .= ' LEFT JOIN {{%issue_partner}} ON ipa_iss_id=iss_id'; } if (!empty($options['show_authorized_issues']) || $role_id == User::getRoleID('Reporter') && Project::getSegregateReporters($prj_id)) { $stmt .= ' LEFT JOIN {{%issue_user_replier}} ON iur_iss_id=iss_id'; } if (!empty($options['show_notification_list_issues'])) { $stmt .= ' LEFT JOIN {{%subscription}} ON sub_iss_id=iss_id'; } if (!empty($options['product'])) { $stmt .= ' LEFT JOIN {{%issue_product_version}} ON ipv_iss_id=iss_id'; } $stmt .= "\n LEFT JOIN\n {{%group}}\n ON\n iss_grp_id=grp_id\n LEFT JOIN\n {{%project_category}}\n ON\n iss_prc_id=prc_id\n LEFT JOIN\n {{%project_release}}\n ON\n iss_pre_id = pre_id\n LEFT JOIN\n {{%status}}\n ON\n iss_sta_id=sta_id\n LEFT JOIN\n {{%project_priority}}\n ON\n iss_pri_id=pri_id\n LEFT JOIN\n {{%project_severity}}\n ON\n iss_sev_id=sev_id\n LEFT JOIN\n {{%issue_quarantine}}\n ON\n iss_id=iqu_iss_id AND\n (iqu_expiration > '" . Date_Helper::getCurrentDateGMT() . "' OR iqu_expiration IS NULL)\n WHERE\n iss_prj_id= " . Misc::escapeInteger($prj_id); $stmt .= self::buildWhereClause($options); if (strstr($options['sort_by'], 'custom_field') !== false) { $fld_details = Custom_Field::getDetails($fld_id); $sort_by = 'cf_sort.' . Custom_Field::getDBValueFieldNameByType($fld_details['fld_type']); } else { $sort_by = Misc::escapeString($options['sort_by']); } $stmt .= ' GROUP BY iss_id ORDER BY ' . $sort_by . ' ' . Misc::escapeString($options['sort_order']) . ', iss_id DESC'; $total_rows = Pager::getTotalRows($stmt); $stmt .= ' LIMIT ' . Misc::escapeInteger($max) . ' OFFSET ' . Misc::escapeInteger($start); try { $res = DB_Helper::getInstance()->getAll($stmt); } catch (DbException $e) { return array('list' => null, 'info' => null, 'csv' => null); } if (count($res) > 0) { Issue::getAssignedUsersByIssues($res); Time_Tracking::fillTimeSpentByIssues($res); // need to get the customer titles for all of these issues... if (CRM::hasCustomerIntegration($prj_id)) { $crm = CRM::getInstance($prj_id); $crm->processListIssuesResult($res); } Issue::formatLastActionDates($res); Issue::getLastStatusChangeDates($prj_id, $res); } elseif ($current_row > 0) { // if there are no results, and the page is not the first page reset page to one and reload results Auth::redirect("list.php?pagerRow=0&rows={$max}"); } $groups = Group::getAssocList($prj_id); $categories = Category::getAssocList($prj_id); $column_headings = array(); $columns_to_display = Display_Column::getColumnsToDisplay($prj_id, 'list_issues'); foreach ($columns_to_display as $col_key => $column) { if ($col_key == 'custom_fields' && count($custom_fields) > 0) { foreach ($custom_fields as $fld_id => $fld_title) { $column_headings['cstm_' . $fld_id] = $fld_title; } } else { $column_headings[$col_key] = $column['title']; } } $csv[] = @implode("\t", $column_headings); if (@$options['hide_excerpts'] != 1 && self::doesBackendSupportExcerpts() == true) { $excerpts = self::getFullTextExcerpts(); } foreach ($res as &$row) { $issue_id = $row['iss_id']; $row['time_spent'] = Misc::getFormattedTime($row['time_spent']); $row['iss_created_date'] = Date_Helper::getFormattedDate($row['iss_created_date']); $row['iss_expected_resolution_date'] = Date_Helper::getSimpleDate($row['iss_expected_resolution_date'], false); $row['excerpts'] = isset($excerpts[$issue_id]) ? $excerpts[$issue_id] : ''; $fields = array(); foreach (array_keys($columns_to_display) as $col_key) { switch ($col_key) { case 'pri_rank': $col_key = 'pri_title'; break; case 'assigned': $col_key = 'assigned_users'; break; case 'sta_rank': $col_key = 'sta_title'; break; case 'sta_change_date': $col_key = 'status_change_date'; break; case 'sev_rank': $col_key = 'sev_title'; break; } if ($col_key == 'custom_fields' && count($custom_fields) > 0) { $custom_field_values = Custom_Field::getListByIssue($prj_id, $row['iss_id']); foreach ($custom_field_values as $this_field) { if (!empty($custom_fields[$this_field['fld_id']])) { $row['custom_field'][$this_field['fld_id']] = $this_field['value']; $fields[] = $this_field['value']; } } } else { $fields[] = isset($row[$col_key]) ? $row[$col_key] : ''; } } if (CRM::hasCustomerIntegration($prj_id)) { // check if current user is a customer and has a per incident contract. // if so, check if issue is redeemed. if (User::getRoleByUser($usr_id, $prj_id) == User::getRoleID('Customer')) { // TODOCRM: Fix per incident usage // if ((Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($res[$i]['iss_id'])) && // (Customer::isRedeemedIncident($prj_id, $res[$i]['iss_id'])))) { // $res[$i]['redeemed'] = true; // } } } $csv[] = @implode("\t", $fields); } $total_pages = ceil($total_rows / $max); $last_page = $total_pages - 1; return array('list' => $res, 'info' => array('current_page' => $current_row, 'start_offset' => $start, 'end_offset' => $start + count($res), 'total_rows' => $total_rows, 'total_pages' => $total_pages, 'previous_page' => $current_row == 0 ? '-1' : $current_row - 1, 'next_page' => $current_row == $last_page ? '-1' : $current_row + 1, 'last_page' => $last_page, 'custom_fields' => $custom_fields), 'csv' => @implode("\n", $csv)); }
/** * Performs standard checks when a user logins */ public static function login($login) { // handle aliases since the user is now authenticated $login = User::getEmail(Auth::getUserIDByLogin($login)); // check if this user did already confirm his account if (Auth::isPendingUser($login)) { Auth::saveLoginAttempt($login, 'failure', 'pending user'); Auth::redirect('index.php?err=9'); } // check if this user is really an active one if (!Auth::isActiveUser($login)) { Auth::saveLoginAttempt($login, 'failure', 'inactive user'); Auth::redirect('index.php?err=7'); } Auth::saveLoginAttempt($login, 'success'); $remember = !empty($_POST['remember']); Auth::createLoginCookie(APP_COOKIE, $login, $remember); Session::init(User::getUserIDByEmail($login)); }
if (Validation::isWhitespace($login)) { Auth::redirect('index.php?err=1'); } $passwd = isset($_POST['passwd']) ? (string) $_POST['passwd'] : null; if (Validation::isWhitespace($passwd)) { Auth::saveLoginAttempt($login, 'failure', 'empty password'); Auth::redirect('index.php?err=2&email=' . rawurlencode($login)); } // check if user exists if (!Auth::userExists($login)) { Auth::saveLoginAttempt($login, 'failure', 'unknown user'); Auth::redirect('index.php?err=3'); } // check if user is locked if (Auth::isUserBackOffLocked(Auth::getUserIDByLogin($login))) { Auth::saveLoginAttempt($login, 'failure', 'account back-off locked'); Auth::redirect('index.php?err=13'); } // check if the password matches if (!Auth::isCorrectPassword($login, $passwd)) { Auth::saveLoginAttempt($login, 'failure', 'wrong password'); Auth::redirect('index.php?err=3&email=' . rawurlencode($login)); } Auth::login($login); if (!empty($_POST['url'])) { $extra = '?url=' . urlencode($_POST['url']); } else { $extra = ''; } Auth::redirect('select_project.php' . $extra);
<article id="content"> <div class="auth-form"> <?php if (isset($_POST['signin'])) { $db = new DBConnect(); $mysqli = $db->mysqli; $param_id = $_POST['id']; $param_pw = $_POST['password']; $id = $mysqli->real_escape_string($param_id); $password = $mysqli->real_escape_string($_POST['password']); $auth = new Auth(); $signin = $auth->signin($id, $password); if ($signin) { echo "로그인 성공"; $auth->redirect('index.php'); } else { echo "로그인 실패 ERRORCODE :" . $signin->error; } } ?> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?> " method="post"> <input type="text" name="id" placeholder="아이디를 입력해 주세요."></br> <input type="password" name="password" placeholder="비밀번호를 입력해 주세요."></br> <input type="submit" name="signin" value="로그인"> </form> </div> </article>
if (Search::getParam('hide_closed', true) === '') { $options_override['hide_closed'] = 0; } $_REQUEST['nosave'] = 1; $profile = Search_Profile::getProfile($usr_id, $prj_id, 'issue'); Search_Profile::remove($usr_id, $prj_id, 'issue'); Auth::redirect('list.php?customer_id=' . Misc::escapeString($_REQUEST['customer_id']) . "&hide_closed=1&rows={$rows}&sort_by=" . $profile['sort_by'] . '&sort_order=' . $profile['sort_order'] . '&nosave=1'); } elseif ($_REQUEST['view'] == 'reporter' && isset($_REQUEST['reporter_id'])) { $profile = Search_Profile::getProfile($usr_id, $prj_id, 'issue'); Auth::redirect('list.php?reporter=' . Misc::escapeInteger($_REQUEST['reporter_id']) . "&hide_closed=1&rows={$rows}&sort_by=" . $profile['sort_by'] . '&sort_order=' . $profile['sort_order'] . '&nosave=1'); } elseif ($_REQUEST['view'] == 'clear') { Search_Profile::remove($usr_id, $prj_id, 'issue'); Auth::redirect('list.php'); } elseif ($_REQUEST['view'] == 'clearandfilter') { Search_Profile::remove($usr_id, $prj_id, 'issue'); Auth::redirect('list.php?' . str_replace('view=clearandfilter&', '', $_SERVER['QUERY_STRING'])); } } if (!empty($_REQUEST['nosave'])) { $options = Search::saveSearchParams(false); } else { $options = Search::saveSearchParams(); } $options += $options_override; $options = array_merge($options, $options_override); $tpl->assign('options', $options); $tpl->assign('sorting', Search::getSortingInfo($options)); // generate options for assign list. If there are groups and user is above a customer, include groups $groups = Group::getAssocList($prj_id); $users = Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')); $assign_options = array('' => ev_gettext('Any'), '-1' => ev_gettext('un-assigned'), '-2' => ev_gettext('myself and un-assigned'));
/* vim: set expandtab tabstop=4 shiftwidth=4 encoding=utf-8: */ // +----------------------------------------------------------------------+ // | Eventum - Issue Tracking System | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 - 2008 MySQL AB | // | Copyright (c) 2008 - 2010 Sun Microsystem Inc. | // | Copyright (c) 2011 - 2013 Eventum Team. | // | | // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation; either version 2 of the License, or | // | (at your option) any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../init.php'; Auth::logout(); Auth::redirect('index.php?err=6');
include_once APP_INC_PATH . "class.auth.php"; include_once APP_INC_PATH . "class.category.php"; include_once APP_INC_PATH . "class.priority.php"; include_once APP_INC_PATH . "class.release.php"; include_once APP_INC_PATH . "class.issue.php"; include_once APP_INC_PATH . "class.misc.php"; include_once APP_INC_PATH . "class.group.php"; include_once APP_INC_PATH . "class.support.php"; include_once APP_INC_PATH . "class.custom_field.php"; include_once APP_INC_PATH . "class.setup.php"; include_once APP_INC_PATH . "db_access.php"; $tpl = new Template_API(); $tpl->setTemplate("new.tpl.html"); Auth::checkAuthentication(APP_COOKIE); if (Auth::getCurrentRole() < User::getRoleID("Reporter")) { Auth::redirect("main.php"); } $usr_id = Auth::getUserID(); $prj_id = Auth::getCurrentProject(); if (Customer::hasCustomerIntegration($prj_id)) { if (Auth::getCurrentRole() == User::getRoleID('Customer')) { $customer_id = User::getCustomerID($usr_id); // check if the current customer has already redeemed all available per-incident tickets if (empty($HTTP_POST_VARS['cat']) && Customer::hasPerIncidentContract($prj_id, $customer_id) && !Customer::hasIncidentsLeft($prj_id, $customer_id)) { // show warning about per-incident limitation $tpl->setTemplate("customer/" . Customer::getBackendImplementationName($prj_id) . "/incident_limit_reached.tpl.html"); $tpl->assign('customer', Customer::getDetails($prj_id, $customer_id)); $tpl->displayTemplate(); exit; } $tpl->assign("message", Customer::getNewIssueMessage($prj_id, $customer_id));
// | (at your option) any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../../../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate("customer/customer_lookup.tpl.html"); Auth::checkAuthentication(APP_COOKIE); $usr_id = Auth::getUserID(); $prj_id = Auth::getCurrentProject(); // only customers should be able to use this page $role_id = Auth::getCurrentRole(); if ($role_id < User::getRoleID('Developer')) { Auth::redirect("list.php"); } if (@$_POST['cat'] == 'lookup') { $tpl->assign("results", Customer_OLD::lookup($prj_id, $_POST['field'], $_POST['value'])); } $tpl->displayTemplate();
/** * Method used to get the list of issues to be displayed in the grid layout. * * @access public * @param integer $prj_id The current project ID * @param array $options The search parameters * @param integer $current_row The current page number * @param integer $max The maximum number of rows per page * @return array The list of issues to be displayed */ function getListing($prj_id, $options, $current_row = 0, $max = 5, $get_reporter = FALSE) { if (strtoupper($max) == "ALL") { $max = 9999999; } $start = $current_row * $max; // get the current user's role $usr_id = Auth::getUserID(); $role_id = User::getRoleByUser($usr_id, $prj_id); // get any custom fields that should be displayed $custom_fields = Custom_Field::getFieldsToBeListed($prj_id); $stmt = "SELECT\n iss_id,\n iss_grp_id,\n iss_prj_id,\n iss_sta_id,\n iss_customer_id,\n iss_created_date,\n iss_updated_date,\n iss_last_response_date,\n iss_closed_date,\n iss_last_customer_action_date,\n iss_usr_id,\n iss_summary,\n pri_title,\n prc_title,\n sta_title,\n sta_color status_color,\n sta_id,\n iqu_status,\n grp_name `group`,\n pre_title,\n iss_last_public_action_date,\n iss_last_public_action_type,\n iss_last_internal_action_date,\n iss_last_internal_action_type,\n " . Issue::getLastActionFields() . ",\n IF(iss_last_internal_action_date > iss_last_public_action_date, 'internal', 'public') AS action_type,\n iss_private,\n CONCAT(en_firstname,' ', en_lastname) as usr_full_name,\n iss_percent_complete,\n iss_dev_time,\n iss_expected_resolution_date\n FROM\n (\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,\n " . ETEL_USER_TABLE_NOSUB . ""; // join custom fields if we are searching by custom fields if (is_array($options['custom_field']) && count($options['custom_field']) > 0) { foreach ($options['custom_field'] as $fld_id => $search_value) { if (empty($search_value)) { continue; } $field = Custom_Field::getDetails($fld_id); if ($field['fld_type'] == 'date' && (empty($search_value['Year']) || empty($search_value['Month']) || empty($search_value['Day']))) { continue; } if ($field['fld_type'] == 'multiple') { $search_value = Misc::escapeInteger($search_value); foreach ($search_value as $cfo_id) { $stmt .= ",\n" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field as cf" . $fld_id . '_' . $cfo_id . "\n"; } } else { $stmt .= ",\n" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field as cf" . $fld_id . "\n"; } } } $stmt .= ")"; // check for the custom fields we want to sort by if (strstr($options['sort_by'], 'custom_field') !== false) { $fld_id = str_replace("custom_field_", '', $options['sort_by']); $stmt .= "\n LEFT JOIN \n" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_custom_field as cf_sort\n ON\n (cf_sort.icf_iss_id = iss_id AND cf_sort.icf_fld_id = {$fld_id}) \n"; } // START ETEL MODIFIED if (!empty($options["show_authorized_issues"]) || $role_id <= User::getRoleID("Standard User") && Project::getSegregateReporters($prj_id)) { $stmt .= "\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user_replier\n ON\n iur_iss_id=iss_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user\n ON\n isu_iss_id=iss_id"; } else { if (!empty($options["users"])) { $stmt .= "\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user\n ON\n isu_iss_id=iss_id"; } } // END ETEL MODIFIED if (!empty($options["show_notification_list_issues"])) { $stmt .= "\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "subscription\n ON\n sub_iss_id=iss_id"; } $stmt .= "\n LEFT JOIN\n " . APP_DEFAULT_DB . ".`" . APP_TABLE_PREFIX . "group`\n ON\n iss_grp_id=grp_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category\n ON\n iss_prc_id=prc_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release\n ON\n iss_pre_id = pre_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status\n ON\n iss_sta_id=sta_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority\n ON\n iss_pri_id=pri_id\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_quarantine\n ON\n iss_id=iqu_iss_id AND\n (iqu_expiration > '" . Date_API::getCurrentDateGMT() . "' OR iqu_expiration IS NULL)\n WHERE\n iss_prj_id= " . Misc::escapeInteger($prj_id); $stmt .= Issue::buildWhereClause($options); //echo $stmt; if (strstr($options["sort_by"], 'custom_field') !== false) { $sort_by = 'cf_sort.icf_value'; } else { $sort_by = Misc::escapeString($options["sort_by"]); } $stmt .= "\n GROUP BY\n iss_id\n ORDER BY\n " . $sort_by . " " . Misc::escapeString($options["sort_order"]) . ",\n iss_id DESC"; $total_rows = Pager::getTotalRows($stmt); if ($max > 100) { $max = 100; } $stmt .= "\n LIMIT\n " . Misc::escapeInteger($start) . ", " . Misc::escapeInteger($max); $res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC); // echo $stmt; if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return array("list" => "", "info" => ""); } else { if (count($res) > 0) { if ($get_reporter) { Issue::getReportersByIssues($res); } Issue::getAssignedUsersByIssues($res); Time_Tracking::getTimeSpentByIssues($res); // need to get the customer titles for all of these issues... if (Customer::hasCustomerIntegration($prj_id)) { Customer::getCustomerTitlesByIssues($prj_id, $res); } Issue::formatLastActionDates($res); Issue::getLastStatusChangeDates($prj_id, $res); } elseif ($current_row > 0) { // if there are no results, and the page is not the first page reset page to one and reload results Auth::redirect(APP_RELATIVE_URL . "list.php?pagerRow=0&rows={$max}"); } $groups = Group::getAssocList($prj_id); $categories = Category::getAssocList($prj_id); $column_headings = Issue::getColumnHeadings($prj_id); if (count($custom_fields) > 0) { $column_headings = array_merge($column_headings, $custom_fields); } $csv[] = @implode("\t", $column_headings); for ($i = 0; $i < count($res); $i++) { $res[$i]["time_spent"] = Misc::getFormattedTime($res[$i]["time_spent"]); $res[$i]["iss_expected_resolution_date"] = Date_API::getSimpleDate($res[$i]["iss_expected_resolution_date"], false); $fields = array($res[$i]['pri_title'], $res[$i]['iss_id']); // hide the group column from the output if no // groups are available in the database if (count($groups) > 0) { $fields[] = $res[$i]['group']; } $fields[] = $res[$i]['assigned_users']; $fields[] = $res[$i]['time_spent']; // hide the category column from the output if no // categories are available in the database if (count($categories) > 0) { $fields[] = $res[$i]['prc_title']; } if (Customer::hasCustomerIntegration($prj_id)) { $fields[] = @$res[$i]['customer_title']; // check if current user is acustomer and has a per incident contract. // if so, check if issue is redeemed. if (User::getRoleByUser($usr_id, $prj_id) == User::getRoleID('Customer')) { if (Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($res[$i]['iss_id'])) && Customer::isRedeemedIncident($prj_id, $res[$i]['iss_id'])) { $res[$i]['redeemed'] = true; } } } $fields[] = $res[$i]['sta_title']; $fields[] = $res[$i]["status_change_date"]; $fields[] = $res[$i]["last_action_date"]; $fields[] = $res[$i]['iss_summary']; if (count($custom_fields) > 0) { $res[$i]['custom_field'] = array(); $custom_field_values = Custom_Field::getListByIssue($prj_id, $res[$i]['iss_id']); foreach ($custom_field_values as $this_field) { if (!empty($custom_fields[$this_field['fld_id']])) { $res[$i]['custom_field'][$this_field['fld_id']] = $this_field['icf_value']; $fields[] = $this_field['icf_value']; } } } $csv[] = @implode("\t", $fields); } $total_pages = ceil($total_rows / $max); $last_page = $total_pages - 1; return array("list" => $res, "info" => array("current_page" => $current_row, "start_offset" => $start, "end_offset" => $start + count($res), "total_rows" => $total_rows, "total_pages" => $total_pages, "previous_page" => $current_row == 0 ? "-1" : $current_row - 1, "next_page" => $current_row == $last_page ? "-1" : $current_row + 1, "last_page" => $last_page, "custom_fields" => $custom_fields), "csv" => @implode("\n", $csv)); } }
// | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate('confirm.tpl.html'); if (@$_GET['cat'] == 'newuser') { $res = @User::checkHash($_GET['email'], $_GET['hash']); if ($res == 1) { User::confirmVisitorAccount($_GET['email']); // redirect user to login form with pretty message Auth::redirect('index.php?err=8&email=' . $_GET['email']); exit; } $tpl->assign('confirm_result', $res); } elseif (@$_GET['cat'] == 'password') { $res = @User::checkHash($_GET['email'], $_GET['hash']); if ($res == 1) { User::confirmNewPassword($_GET['email']); $tpl->assign('email', $_GET['email']); } $tpl->assign('confirm_result', $res); } $tpl->displayTemplate();
<?php include 'api/classes/Auth.php'; include 'api/classes/Request.php'; include 'api/classes/Model/Quest.php'; session_start(); session_save_path('./session'); echo $_SESSION['username']; $db = new DBConnect(); $mysqli = $db->mysqli; $pdo = $db->getPDO(); $auth = new Auth(); if (!$auth->is_loggedin()) { $auth->redirect("/auth/index.php"); } $uid = $_SESSION['user_session']; $request = new Request($uid); ?> <!DOCTYPE html> <html> <head> <title>Questian :: Timeline</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0"> <meta name="theme-color" content="#00bcd9"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> <link rel="stylesheet" href="//rawgit.com/Soldier-B/jquery.toast/master/jquery.toast/jquery.toast.min.css" /> <link rel="stylesheet" href="css/noto.css">
// | Copyright (c) 2008 - 2010 Sun Microsystem Inc. | // | Copyright (c) 2011 - 2013 Eventum Team. | // | | // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation; either version 2 of the License, or | // | (at your option) any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate('duplicate.tpl.html'); Auth::checkAuthentication(APP_COOKIE); if (@$_POST['cat'] == 'mark') { Misc::mapMessages(Issue::markAsDuplicate($_POST['issue_id']), array(1 => array(ev_gettext('Thank you, the issue was marked as a duplicate successfully'), Misc::MSG_INFO), -1 => array(ev_gettext('Sorry, an error happened while trying to run your query.'), Misc::MSG_ERROR))); Auth::redirect(APP_RELATIVE_URL . 'view.php?id=' . $_POST['issue_id']); } $tpl->displayTemplate();
// | Copyright (c) 2003 - 2008 MySQL AB | // | Copyright (c) 2008 - 2010 Sun Microsystem Inc. | // | Copyright (c) 2011 - 2013 Eventum Team. | // | | // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation; either version 2 of the License, or | // | (at your option) any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../../init.php'; Auth::checkAuthentication(APP_COOKIE); if (!Access::canAccessReports(Auth::getUserID())) { Auth::redirect(APP_RELATIVE_URL . 'main.php'); } $tpl = new Template_Helper(); $tpl->setTemplate('reports/index.tpl.html'); $tpl->displayTemplate();
// | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation; either version 2 of the License, or | // | (at your option) any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ require_once __DIR__ . '/../../../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate('customer/customer_lookup.tpl.html'); Auth::checkAuthentication(); $usr_id = Auth::getUserID(); $prj_id = Auth::getCurrentProject(); // only customers should be able to use this page $role_id = Auth::getCurrentRole(); if ($role_id < User::ROLE_DEVELOPER) { Auth::redirect('list.php'); } if (@$_POST['cat'] == 'lookup') { $tpl->assign('results', Customer_OLD::lookup($prj_id, $_POST['field'], $_POST['value'])); } $tpl->displayTemplate();
include_once APP_INC_PATH . "class.auth.php"; include_once APP_INC_PATH . "class.category.php"; include_once APP_INC_PATH . "class.priority.php"; include_once APP_INC_PATH . "class.misc.php"; include_once APP_INC_PATH . "class.release.php"; include_once APP_INC_PATH . "class.project.php"; include_once APP_INC_PATH . "class.filter.php"; include_once APP_INC_PATH . "class.status.php"; include_once APP_INC_PATH . "class.user.php"; $tpl = new Template_API(); $tpl->setTemplate("adv_search.tpl.html"); Auth::checkAuthentication(APP_COOKIE); // customers should not be able to see this page $role_id = Auth::getCurrentRole(); if ($role_id < User::getRoleID('Standard User')) { Auth::redirect(APP_RELATIVE_URL . "list.php"); } $prj_id = Auth::getCurrentProject(); // generate options for assign list. If there are groups and user is above a customer, include groups $groups = Group::getAssocList($prj_id); $users = Project::getUserAssocList($prj_id, 'active', User::getRoleID('Customer')); $assign_options = array("" => "Any", "-1" => "un-assigned", "-2" => "myself and un-assigned"); if (User::getGroupID(Auth::getUserID()) != '') { $assign_options['-3'] = 'myself and my group'; $assign_options['-4'] = 'myself, un-assigned and my group'; } if (count($groups) > 0 && $role_id > User::getRoleID("Customer")) { foreach ($groups as $grp_id => $grp_name) { $assign_options["grp:{$grp_id}"] = "Group: " . $grp_name; } }
$tpl->setTemplate('select_customer.tpl.html'); session_start(); // check if cookies are enabled, first of all if (!Auth::hasCookieSupport(APP_COOKIE)) { Auth::redirect('index.php?err=11'); } if (!Auth::hasValidCookie(APP_COOKIE)) { Auth::redirect('index.php?err=5'); } $prj_id = Auth::getCurrentProject(); $usr_id = Auth::getUserID(); $contact_id = User::getCustomerContactID($usr_id); if (!CRM::hasCustomerIntegration($prj_id) || empty($contact_id)) { Auth::redirect('main.php'); } $crm = CRM::getInstance($prj_id); $contact = $crm->getContact($contact_id); $customers = $contact->getCustomers(); if (isset($_REQUEST['customer_id'])) { $customer_id = $_REQUEST['customer_id']; if (in_array($customer_id, array_keys($customers))) { Auth::setCurrentCustomerID($customer_id); if (!empty($_POST['url'])) { Auth::redirect($_REQUEST['url']); } else { Auth::redirect('main.php'); } } } $tpl->assign('customers', $customers); $tpl->displayTemplate();
} // check if user exists if (!Auth::userExists($HTTP_POST_VARS["email"])) { Auth::saveLoginAttempt($HTTP_POST_VARS["email"], 'failure', 'unknown user'); Auth::redirect(APP_RELATIVE_URL . "index.php?err=3"); } // check if the password matches if (!Auth::isCorrectPassword($HTTP_POST_VARS["email"], $HTTP_POST_VARS["passwd"])) { Auth::saveLoginAttempt($HTTP_POST_VARS["email"], 'failure', 'wrong password'); Auth::redirect(APP_RELATIVE_URL . "index.php?err=3&email=" . $HTTP_POST_VARS["email"]); } // check if this user did already confirm his account if (Auth::isPendingUser($HTTP_POST_VARS["email"])) { Auth::saveLoginAttempt($HTTP_POST_VARS["email"], 'failure', 'pending user'); Auth::redirect(APP_RELATIVE_URL . "index.php?err=9", $is_popup); } // check if this user is really an active one if (!Auth::isActiveUser($HTTP_POST_VARS["email"])) { Auth::saveLoginAttempt($HTTP_POST_VARS["email"], 'failure', 'inactive user'); Auth::redirect(APP_RELATIVE_URL . "index.php?err=7", $is_popup); } Auth::saveLoginAttempt($HTTP_POST_VARS["email"], 'success'); // redirect to the initial page @Auth::createLoginCookie(APP_COOKIE, $HTTP_POST_VARS["email"], $HTTP_POST_VARS["remember_login"]); if (!empty($HTTP_POST_VARS["url"])) { $extra = '?url=' . urlencode($HTTP_POST_VARS["url"]); } else { $extra = ''; } Auth::redirect(APP_RELATIVE_URL . "select_project.php" . $extra);
/** * Gets the current selected project from the project cookie. * * @access public * @return integer The project ID */ function getCurrentProject() { $cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE); if (empty($cookie)) { return ""; } $usr_id = Auth::getUserID(); $projects = Project::getAssocList($usr_id); if ($usr_id == APP_SYSTEM_USER_ID) { return $cookie['prj_id']; } if (!in_array($cookie["prj_id"], array_keys($projects))) { Auth::redirect(APP_RELATIVE_URL . "select_project.php?err=1"); } return $cookie["prj_id"]; }
// +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ // // @(#) $Id: s.confirm.php 1.3 03/12/04 17:58:15-00:00 jpradomaia $ // include_once "config.inc.php"; include_once APP_INC_PATH . "class.template.php"; include_once APP_INC_PATH . "class.user.php"; include_once APP_INC_PATH . "class.auth.php"; include_once APP_INC_PATH . "db_access.php"; $tpl = new Template_API(); $tpl->setTemplate("confirm.tpl.html"); if (@$HTTP_GET_VARS['cat'] == 'newuser') { $res = @User::checkHash($HTTP_GET_VARS["email"], $HTTP_GET_VARS["hash"]); if ($res == 1) { User::confirmVisitorAccount($HTTP_GET_VARS["email"]); // redirect user to login form with pretty message Auth::redirect('index.php?err=8&email=' . $HTTP_GET_VARS["email"]); exit; } $tpl->assign("confirm_result", $res); } elseif (@$HTTP_GET_VARS['cat'] == 'password') { $res = @User::checkHash($HTTP_GET_VARS["email"], $HTTP_GET_VARS["hash"]); if ($res == 1) { User::confirmNewPassword($HTTP_GET_VARS["email"]); $tpl->assign("email", $HTTP_GET_VARS["email"]); } $tpl->assign("confirm_result", $res); } $tpl->displayTemplate();
/** * Method used to get the list of emails to be displayed in the * grid layout. * * @param array $options The search parameters * @param integer $current_row The current page number * @param integer $max The maximum number of rows per page * @return array The list of issues to be displayed */ public static function getEmailListing($options, $current_row = 0, $max = 5) { $prj_id = Auth::getCurrentProject(); if ($max == 'ALL') { $max = 9999999; } $start = $current_row * $max; $stmt = 'SELECT sup_id, sup_ema_id, sup_iss_id, sup_customer_id, sup_from, sup_date, sup_to, sup_subject, sup_has_attachment FROM ( {{%support_email}}, {{%email_account}}'; if (!empty($options['keywords'])) { $stmt .= ', {{%support_email_body}} '; } $stmt .= ' ) LEFT JOIN {{%issue}} ON sup_iss_id = iss_id'; $stmt .= self::buildWhereClause($options); $stmt .= ' ORDER BY ' . Misc::escapeString($options['sort_by']) . ' ' . Misc::escapeString($options['sort_order']); $total_rows = Pager::getTotalRows($stmt); $stmt .= ' LIMIT ' . Misc::escapeInteger($max) . ' OFFSET ' . Misc::escapeInteger($start); try { $res = DB_Helper::getInstance()->getAll($stmt); } catch (DbException $e) { return array('list' => '', 'info' => ''); } if (count($res) < 1 && $current_row > 0) { // if there are no results, and the page is not the first page reset page to one and reload results Auth::redirect("emails.php?pagerRow=0&rows={$max}"); } if (CRM::hasCustomerIntegration($prj_id)) { $crm = CRM::getInstance($prj_id); $customer_ids = array(); foreach ($res as $row) { if (!empty($row['sup_customer_id']) && !in_array($row['sup_customer_id'], $customer_ids)) { $customer_ids[] = $row['sup_customer_id']; } } if (count($customer_ids) > 0) { $company_titles = $crm->getCustomerTitles($customer_ids); } } foreach ($res as &$row) { $row['sup_date'] = Date_Helper::getFormattedDate($row['sup_date']); $row['sup_subject'] = Mime_Helper::fixEncoding($row['sup_subject']); $row['sup_from'] = implode(', ', Mail_Helper::getName($row['sup_from'], true)); if (empty($row['sup_to']) && !empty($row['sup_iss_id'])) { $row['sup_to'] = 'Notification List'; } else { $to = Mail_Helper::getName($row['sup_to']); // Ignore unformattable headers if (!Misc::isError($to)) { $row['sup_to'] = Mime_Helper::fixEncoding($to); } } if (CRM::hasCustomerIntegration($prj_id)) { // FIXME: $company_titles maybe used uninitialied $row['customer_title'] = $company_titles[$row['sup_customer_id']]; } } $total_pages = ceil($total_rows / $max); $last_page = $total_pages - 1; return array('list' => $res, 'info' => array('current_page' => $current_row, 'start_offset' => $start, 'end_offset' => $start + count($res), 'total_rows' => $total_rows, 'total_pages' => $total_pages, 'previous_page' => $current_row == 0 ? '-1' : $current_row - 1, 'next_page' => $current_row == $last_page ? '-1' : $current_row + 1, 'last_page' => $last_page)); }
/** * Method used to get the list of emails to be displayed in the * grid layout. * * @access public * @param array $options The search parameters * @param integer $current_row The current page number * @param integer $max The maximum number of rows per page * @return array The list of issues to be displayed */ function getEmailListing($options, $current_row = 0, $max = 5) { $prj_id = Auth::getCurrentProject(); $usr_id = Auth::getUserID(); if ($max == "ALL") { $max = 9999999; } $start = $current_row * $max; $stmt = "SELECT\n sup_id,\n sup_ema_id,\n sup_iss_id,\n sup_customer_id,\n sup_from,\n sup_date,\n sup_to,\n sup_subject,\n sup_has_attachment\n FROM\n (\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email,\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "email_account"; if (!empty($options['keywords'])) { $stmt .= "," . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email_body"; } $stmt .= "\n )\n LEFT JOIN\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n ON\n sup_iss_id = iss_id"; $stmt .= Support::buildWhereClause($options); $stmt .= "\n ORDER BY\n " . Misc::escapeString($options["sort_by"]) . " " . Misc::escapeString($options["sort_order"]); $total_rows = Pager::getTotalRows($stmt); $stmt .= "\n LIMIT\n " . Misc::escapeInteger($start) . ", " . Misc::escapeInteger($max); $res = $GLOBALS["db_api"]->dbh->getAll($stmt, DB_FETCHMODE_ASSOC); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return array("list" => "", "info" => ""); } else { if (count($res) < 1 && $current_row > 0) { // if there are no results, and the page is not the first page reset page to one and reload results Auth::redirect(APP_RELATIVE_URL . "emails.php?pagerRow=0&rows={$max}"); } if (Customer::hasCustomerIntegration($prj_id)) { $customer_ids = array(); for ($i = 0; $i < count($res); $i++) { if (!empty($res[$i]['sup_customer_id']) && !in_array($res[$i]['sup_customer_id'], $customer_ids)) { $customer_ids[] = $res[$i]['sup_customer_id']; } } if (count($customer_ids) > 0) { $company_titles = Customer::getTitles($prj_id, $customer_ids); } } for ($i = 0; $i < count($res); $i++) { $res[$i]["sup_date"] = Date_API::getFormattedDate($res[$i]["sup_date"]); $res[$i]["sup_subject"] = Mime_Helper::fixEncoding($res[$i]["sup_subject"]); $res[$i]["sup_from"] = join(', ', Mail_API::getName($res[$i]["sup_from"], true)); if (empty($res[$i]["sup_to"]) && !empty($res[$i]["sup_iss_id"])) { $res[$i]["sup_to"] = "Notification List"; } else { $res[$i]["sup_to"] = Mime_Helper::fixEncoding(Mail_API::getName($res[$i]["sup_to"])); } if (Customer::hasCustomerIntegration($prj_id)) { @($res[$i]['customer_title'] = $company_titles[$res[$i]['sup_customer_id']]); } } $total_pages = ceil($total_rows / $max); $last_page = $total_pages - 1; return array("list" => $res, "info" => array("current_page" => $current_row, "start_offset" => $start, "end_offset" => $start + count($res), "total_rows" => $total_rows, "total_pages" => $total_pages, "previous_page" => $current_row == 0 ? "-1" : $current_row - 1, "next_page" => $current_row == $last_page ? "-1" : $current_row + 1, "last_page" => $last_page)); } }
// | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: Dave Anderson <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate('edit_reporter.tpl.html'); Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true); $prj_id = Auth::getCurrentProject(); $issue_id = @$_POST['issue_id'] ? $_POST['issue_id'] : $_GET['iss_id']; $tpl->assign('issue_id', $issue_id); if (!Access::canChangeReporter($issue_id, Auth::getUserID())) { $tpl->setTemplate('permission_denied.tpl.html'); $tpl->displayTemplate(); exit; } if (@$_POST['cat'] == 'update') { $res = Edit_Reporter::update($issue_id, trim($_POST['email'])); Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the Reporter was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the Reporter.'), Misc::MSG_ERROR))); Auth::redirect(APP_RELATIVE_URL . 'view.php?id=' . $issue_id); } $t = Project::getAddressBook($prj_id, $issue_id); $tpl->assign('allowed_reporters', $t); $tpl->displayTemplate();
$tpl->assign('default_actions', $res); $cat = isset($_POST['cat']) ? (string) $_POST['cat'] : (isset($_GET['cat']) ? (string) $_GET['cat'] : null); if ($cat == 'insert') { $res = Notification::subscribeEmail($usr_id, $issue_id, $_POST['email'], $_POST['actions']); if ($res == 1) { Misc::setMessage(ev_gettext('Thank you, the email has been subscribed to the issue.')); } } elseif ($cat == 'update') { $res = Notification::update($issue_id, $_POST['id'], $_POST['email']); if ($res == 1) { Misc::setMessage(ev_gettext('Thank you, the notification entry was updated successfully.')); } elseif ($res == -1) { Misc::setMessage(ev_gettext('An error occurred while trying to update the notification entry.'), Misc::MSG_ERROR); } elseif ($res == -2) { Misc::setMessage(ev_gettext('Error: the given email address is not allowed to be added to the notification list.'), Misc::MSG_ERROR); } Auth::redirect(APP_RELATIVE_URL . 'notification.php?iss_id=' . $issue_id); } elseif ($cat == 'edit') { $res = Notification::getDetails($_GET['id']); $tpl->assign('info', $res); } elseif ($cat == 'delete') { $res = Notification::remove($_POST['items']); if ($res == 1) { Misc::setMessage(ev_gettext('Thank you, the items have been deleted.')); } } $tpl->assign('list', Notification::getSubscriberListing($issue_id)); $t = Project::getAddressBook($prj_id, $issue_id); $tpl->assign('assoc_users', $t); $tpl->assign('allowed_emails', Project::getAddressBookEmails($prj_id, $issue_id)); $tpl->displayTemplate();
// | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation; either version 2 of the License, or | // | (at your option) any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 59 Temple Place - Suite 330 | // | Boston, MA 02111-1307, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // +----------------------------------------------------------------------+ // // @(#) $Id: s.logout.php 1.6 03/01/20 05:09:53-00:00 jpm $ // include_once "config.inc.php"; include_once APP_INC_PATH . "class.auth.php"; Auth::removeCookie(APP_COOKIE); // if 'remember projects' is true don't remove project cookie $project_cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE); if (empty($project_cookie['remember'])) { Auth::removeCookie(APP_PROJECT_COOKIE); } Auth::redirect(APP_RELATIVE_URL . "index.php?err=6");
// | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to: | // | | // | Free Software Foundation, Inc. | // | 51 Franklin Street, Suite 330 | // | Boston, MA 02110-1301, USA. | // +----------------------------------------------------------------------+ // | Authors: João Prado Maia <*****@*****.**> | // | Authors: Elan Ruusamäe <*****@*****.**> | // +----------------------------------------------------------------------+ require_once dirname(__FILE__) . '/../init.php'; Auth::checkAuthentication(APP_COOKIE); $prj_id = $_POST['current_project']; $url = $_SERVER['HTTP_REFERER']; // get the 'remember' setting of the project cookie $cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE); Auth::setCurrentProject($prj_id, $cookie['remember']); Misc::setMessage(ev_gettext('The project has been switched'), Misc::MSG_INFO); // if url is 'view.php', use 'list.php', // otherwise autoswitcher will switch back to the project where the issue was :) if (!$url || stristr($url, 'view.php') !== false) { $url = APP_RELATIVE_URL . 'list.php'; } Auth::redirect($url);
$crm = CRM::getInstance($prj_id); $customer_id = Auth::getCurrentCustomerID(); $customer = $crm->getCustomer($customer_id); $new_issue_message = $customer->getNewIssueMessage(); if ($new_issue_message) { Misc::setMessage($new_issue_message, Misc::MSG_INFO); } } } $cat = isset($_POST['cat']) ? (string) $_POST['cat'] : (isset($_GET['cat']) ? (string) $_GET['cat'] : null); if ($cat == 'report') { $res = Issue::createFromPost(); if ($res != -1) { // redirect to view issue page Misc::setMessage(ev_gettext('Your issue was created successfully.')); Auth::redirect(APP_BASE_URL . 'view.php?id=' . $res); } else { // need to show everything again Misc::setMessage(ev_gettext('There was an error creating your issue.'), Misc::MSG_ERROR); $tpl->assign('error_msg', '1'); } } if ($cat == 'associate') { $item = isset($_GET['item']) ? (array) $_GET['item'] : null; if (count($item) > 0) { $res = Support::getListDetails($item); $tpl->assign('emails', $res); $tpl->assign('attached_emails', @implode(',', $item)); if (CRM::hasCustomerIntegration($prj_id)) { $crm = CRM::getInstance($prj_id); // also need to guess the contact_id from any attached emails
</select> </div> <p>퀘스티안 타임라인의 퀘스트 정렬기준을 선택합니다.</p> </div> <div id="sort-fieldset" class="pref-box"> <label for="sort-field">주변 퀘스트 실시간 알림</label> <input type="checkbox" > <p>자신의 위치 주변에 퀘스트가 공표되면 알려드려요.</p> </div> <input type="submit" value="변경사항 저장"/> </form> <div id="logout-fieldset" class="pref-box"> <?php if (isset($_POST['logout'])) { $auth->logout(); $auth->redirect('auth/index.php'); } ?> <label for="time-zone-field">로그아웃</label> <div class="dropdown"> </div> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?> " method="post"> <input type="submit" value="지금 이 계정을 로그아웃 합니다." name="logout" onclick="window.location = 'index.php'"> </form> </div> </div> </section> </article>