Example #1
0
function dbmgr_main()
{
    echo '<link rel="stylesheet" href="include/styles/dbmanager.css" type="text/css" />';
    $sql = (string) get_parameter('sql');
    $clean_output = get_parameter("clean_output", 0);
    if ($clean_output == 0) {
        echo "<h1>" . __('Extensions') . " &raquo; " . __('Database interface');
        $html_report_image = print_html_report_image("index.php?sec=godmode&sec2=godmode/setup/dbmanager&sql={$sql}", __("Report"));
        if ($html_report_image) {
            echo "&nbsp;&nbsp;" . $html_report_image;
        }
        echo "</h1>";
        echo '<div class="note_simple">';
        echo __("This is an advanced extension to interface with Integria IMS database directly using native SQL sentences. Please note that <b>you can damage</b> your Integria IMS installation if you don't know </b>exactly</b> what are you doing, this means that you can severily damage your setup using this extension. This extension is intended to be used <b>only by experienced users</b> with a depth knowledgue of Integria IMS.");
        echo '</div>';
        echo "<br />";
        echo __("Some samples of usage:") . " <blockquote><em>SHOW STATUS;<br />DESCRIBE tincidencia<br />SELECT * FROM tincidencia<br />UPDATE tincidencia SET sla_disabled = 1 WHERE inicio < '2010-01-10 00:00:00';</em></blockquote>";
        echo "<br /><br />";
        echo "<form method='post' action=''>";
        print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES));
        echo "<div style='width: 99%; text-align: right; margin-top: 6px;'>";
        print_submit_button(__('Execute SQL'), '', false, 'class="sub next"');
        echo "</div>";
        echo "</form>";
    } else {
        echo "<form method='post' action=''>";
        print_textarea('sql', 2, 40, html_entity_decode($sql, ENT_QUOTES));
        echo "<div style='width: 99%; text-align: right; margin-top: 6px;'>";
        print_submit_button(__('Execute SQL'), '', false, 'class="sub next"');
        echo "</div>";
        echo "</form>";
    }
    // Processing SQL Code
    if ($sql == '') {
        return;
    }
    echo "<br />";
    echo "<hr />";
    echo "<br />";
    $error = '';
    $result = dbmanager_query($sql, $error);
    if ($result === false) {
        echo '<strong>An error has occured when querying the database.</strong><br />';
        echo $error;
        return;
    }
    if (!is_array($result)) {
        echo "<strong>Output: <strong>" . $result;
        return;
    }
    $table->width = '90%';
    $table->class = 'dbmanager';
    $table->head = array_keys($result[0]);
    $table->data = $result;
    print_table($table);
}
Example #2
0
/**
 * project_do_mylist - List of projects available to the logged user
 */
function project_do_mylist()
{
    global $PARAMS, $SOAP, $LOG;
    if (get_parameter($PARAMS, "help")) {
        return;
    }
    // Fetch the user ID from the database
    $params = array("user_ids" => array($SOAP->getSessionUser()));
    $res = $SOAP->call("getUsersByName", $params);
    if ($error = $SOAP->getError()) {
        exit_error($error, $SOAP->faultcode);
    }
    $user_id = $res[0]["user_id"];
    $params = array("user_id" => $user_id);
    $res = $SOAP->call("userGetGroups", $params);
    if ($error = $SOAP->getError()) {
        exit_error($error, $SOAP->faultcode);
    }
    show_output($res);
}
Example #3
0
function ranks()
{
    $name = get_parameter("name");
    $ranks = "";
    // read 'ranks.txt' file line by line, extract a line that contains a matching 'name' parameter value
    // 'ranks.txt' file을 한줄 한줄 읽고, 'name' 매개변수의 값을 가진 줄(line)을 추출하시오
    $names_array = file("ranks.txt");
    foreach ($names_array as $line) {
        $tmp_name = explode(" ", $line)[0];
        if ($tmp_name === $name) {
            $ranks .= $line;
            break;
        }
    }
    if ($ranks) {
        // emit a retured ranking data from the 'generate_xml' function as an output in XML data format
        // 'generate_xml' 함수에서 반화하는 랭킹 데이터를 XML 데이터 형식으로 만들어 내보내시오
        return generate_xml($ranks);
    } else {
        header("HTTP/1.1 410 Gone");
        die("HTTP/1.1 410 Gone - There is no data for this name/gender.");
    }
}
Example #4
0
        break;
    case "details":
        include "contact_manage.php";
        break;
    case "files":
        include "contact_files.php";
        break;
    case "activity":
        include "contact_activity.php";
        break;
    default:
        include "contact_manage.php";
}
if ($id == 0 && !$new_contact) {
    $search_text = (string) get_parameter('search_text');
    $id_company = (int) get_parameter('id_company', 0);
    $where_clause = "WHERE 1=1";
    if ($search_text != "") {
        $where_clause .= " AND (fullname LIKE '%{$search_text}%' OR email LIKE '%{$search_text}%' OR phone LIKE '%{$search_text}%' OR mobile LIKE '%{$search_text}%') ";
    }
    if ($id_company) {
        $where_clause .= sprintf(' AND id_company = %d', $id_company);
    }
    $search_params = "&search_text={$search_text}&id_company={$id_company}";
    $table->width = '99%';
    $table->class = 'search-table';
    $table->style = array();
    $table->style[0] = 'font-weight: bold;';
    $table->data = array();
    $table->data[0][0] = print_input_text("search_text", $search_text, "", 15, 100, true, __('Search'));
    $params = array();
// 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 the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
// Load global vars
global $config;
if (check_login() != 0) {
    audit_db("Noauth", $config["REMOTE_ADDR"], "No authenticated access", "Trying to access ticket viewer");
    require "general/noaccess.php";
    exit;
}
$id_nota = get_parameter("id", 0);
$id_incident = get_parameter("id_inc", 0);
// ********************************************************************
// Note detail of $id_note
// ********************************************************************
$sql4 = 'SELECT * FROM tnota WHERE id_nota = ' . $id_nota;
$res4 = mysql_query($sql4);
if ($row3 = mysql_fetch_array($res4)) {
    echo "<div class='notetitle'>";
    // titulo
    $timestamp = $row3["timestamp"];
    $nota = $row3["nota"];
    $id_usuario_nota = $row3["id_usuario"];
    $avatar = get_db_value("avatar", "tusuario", "id_usuario", $id_usuario_nota);
    // Show data
    echo "<img src='images/avatars/" . $avatar . ".png' class='avatar_small'>&nbsp;";
    echo " <a href='index.php?sec=users&sec2=operation/users/user_edit&id={$id_usuario_nota}'>";
// 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.


global $config;
check_login ();

// Get parameters
$id_project = get_parameter ('id_project');
$id_task = get_parameter ('id_task', -1);
$project_manager = get_db_value ('id_owner', 'tproject', 'id', $id_project);
$operation = (string) get_parameter ('operation');
$title = get_parameter ("title", "");
$description = get_parameter ("description", "");

// ACL
$task_permission = get_project_access ($config["id_user"], $id_project, $id_task, false, true);
if (!$task_permission["manage"]) {
	audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to task email report  without permission");
	no_permission();
}

if ($operation == "generate_email") {
	$task_participants = get_db_all_rows_sql ("SELECT direccion, nombre_real FROM tusuario, trole_people_task WHERE tusuario.id_usuario = trole_people_task.id_user AND trole_people_task.id_task = $id_task");
	$participants ="";
	foreach ($task_participants as $participant){
		$participant["direccion"];
		$text = ascii_output ($description);
		$subject = ascii_output ($title);
Example #7
0
function main_control()
{
    // These globals are used in the HTML template
    global $current_player, $history;
    global $heading, $name_white, $name_black;
    global $show_command_form, $flip_board;
    global $preset_from_value, $preset_to_value, $id_focus;
    global $chess_board_markup, $history_markup, $promotion_dialog_markup;
    global $board_encoded, $game_title, $turn_nr;
    global $history_next, $history_prev;
    global $href_this, $href_player, $href_flip;
    global $game_state_link, $hmw_home_link;
    // Initialize a bit
    $promotion_popup = false;
    //...NYI Show pawn promotion dialog
    $show_command_form = true;
    // Show the move input dialog
    $game_status = IN_PROGRESS;
    // The game has not ended yet
    $heading = '';
    // "White's move" caption
    $game_title = '';
    // Current game info for page title
    $game_state_link = '';
    // "Send this link"-link ..
    $hmw_home_link = '';
    // .. corrected for my stupid router
    //... Remember an initial double move of a pawn
    $get_en_passant = get_parameter(GET_EN_PASSANT);
    $new_en_passant = '';
    // Retreive GET data
    $flip_board = isset($_GET[GET_FLIP_BOARD]);
    $history = get_parameter(GET_HISTORY);
    $goto = get_parameter(GET_GOTO);
    $name_white = get_parameter(GET_WHITE, DEFAULT_NAME_WHITE);
    $name_black = get_parameter(GET_BLACK, DEFAULT_NAME_BLACK);
    if (get_parameter(GET_PLAYER, GET_WHITE) != GET_WHITE) {
        //  &player  set, but not to "white", is taken as "black"
        $current_player = BLACKS_MOVE;
    } else {
        $current_player = WHITES_MOVE;
    }
    // Load base positions of pieces
    $base_array = decode_board(get_parameter(GET_BASE_BOARD, INITIAL_BOARD_CODED));
    // Trace history (Reconstruct the current board from initial positions)
    //...list( $board_array, $tie_info ) = decode_history(
    $board_array = decode_history($base_array, $history, $goto);
    // Execute given command
    // Retreive FORM input
    // Move: "from" and "to" must be field names
    // Edit: "from" must be the code character for a piece and "to" a field
    $clickable = $selected = array();
    $redirect_after_move = false;
    $cmd_piece = get_parameter(GET_FROM);
    $cmd_from = strtoupper(get_parameter(GET_FROM));
    // Retreive commands
    $cmd_to = strtoupper(get_parameter(GET_TO));
    if ($cmd_from == $cmd_to) {
        // Deselect a piece
        $cmd_from = $cmd_to = '';
    }
    if ($cmd_from == '') {
        $cmd_to = '';
    }
    // Never allow only TO command
    // Exec: Editor
    if (strlen($cmd_from) == 1 && valid_field_name($cmd_to)) {
        if (strpos(WHITE_PIECES . BLACK_PIECES, $cmd_from) !== false) {
            list($row, $col) = field_to_rowcol($cmd_to);
            if ($base_array[$row][$col] == $cmd_piece) {
                // Delete existing piece
                $base_array[$row][$col] = '';
            } else {
                if ($base_array[$row][$col] == '') {
                    // Add new piece
                    $base_array[$row][$col] = $cmd_piece;
                }
            }
            #$base_array = $board_array;
            $redirect_after_move = true;
        }
        // No other commands with FROM being only one char.
        $cmd_from = $cmd_to = '';
    }
    // Make sure, no invalid data is being processed as a move
    if (!valid_field_name($cmd_from)) {
        $cmd_from = '';
    }
    if (!valid_field_name($cmd_to)) {
        $cmd_to = '';
    }
    // Exec: Move
    if ($cmd_from != '' && $cmd_to != '') {
        $turn_nr = i_to_round($history);
        if ($turn_nr - floor($turn_nr) == 0.5) {
            $turn_nr = floor($turn_nr);
            $color = 'Black';
        } else {
            $color = 'White';
        }
        debug_out($_SERVER['REMOTE_ADDR'] . " - {$name_white} vs. {$name_black}, {$turn_nr}, {$color}: {$cmd_from} - {$cmd_to}\n");
        list($f_row, $f_col) = field_to_rowcol($cmd_from);
        list($t_row, $t_col) = field_to_rowcol($cmd_to);
        list($clickable, $selected) = select_piece($board_array, $current_player, $cmd_from, $get_en_passant);
        // Check if it is our//... piece (or a piece at all)
        if (!in_array($cmd_from, $clickable)) {
            die("Error: clickable[{$f_row}][{$f_col}] empty.");
        }
        if (!in_array($cmd_to, $clickable)) {
            // Capturing a piece!
            echo "Capture! clickable = ";
            print_r($clickable);
            die;
        }
        // En passant
        $piece = $board_array[$f_row][$f_col];
        if ($piece == 'P' && $f_row == 1 || $piece == 'p' && $f_row == 6) {
            if ($t_row == 3 || $t_row == 4) {
                $get_en_passant = chr(ord('A') + $f_col);
            }
        }
        if ($piece == 'P' && $t_row - $f_row == +1 || $piece == 'p' && $t_row - $f_row == -1 || $piece != 'P' && $piece != 'p') {
            $get_en_passant = '';
        }
        // Promotion
        if ($piece == 'P' && $t_row == 7 || $piece == 'p' && $t_row == 0) {
            $href_this = update_href($href_this, GET_PROMOTE, chr(ord('A') + $t_col));
            $promotion_popup = true;
            $heading = 'Promote your pawn to:';
            $board_array = apply_move($board_array, $f_row, $f_col, $t_row, $t_col);
        }
        // New move applied, prepare for fresh move
        $clickable = $selected = array();
        $cmd_from = $cmd_to = '';
        // Fall through to NO COMMAND mode
        $current_player = !$current_player;
        $history .= encode_move($f_row, $f_col, $t_row, $t_col);
        // We changed the board, but the user's browser still shows the
        // move command in its address bar. An HTTP redirect is used to
        // update that address, but the URL is not determined yet
        if (!$promotion_popup) {
            $redirect_after_move = true;
        }
    }
    // Exec: Deselect, continuation of fall throughs above
    if ($cmd_from == '' && $cmd_to == '') {
        $clickable = find_movable_pieces($board_array, $current_player);
        // Get rid of moves with king in check afterwards
        $new = array();
        foreach ($clickable as $from_field) {
            // Get two arrays (clickable, selected)
            $temp = select_piece($board_array, $current_player, $from_field);
            // Ignore moves with only one "deselection entry"
            if (count($temp[0]) > 1) {
                $new[] = $from_field;
            }
        }
        $clickable = $new;
        if (count($clickable) == 0) {
            if (king_in_check($board_array, $current_player)) {
                $heading = HEADING_CHECK_MATE;
                $game_status = $current_player != WHITES_MOVE ? WHITE_WINS : BLACK_WINS;
            } else {
                $heading = HEADING_STALE_MATE;
                $game_status = NOONE_WINS;
            }
        }
    }
    // Exec: Select piece
    if ($cmd_from != '' && $cmd_to == '' && $goto == '') {
        list($clickable, $selected) = select_piece($board_array, $current_player, $cmd_from);
        $heading = 'Select target';
    }
    // Prepare move command form
    $preset_from_value = $cmd_from;
    $preset_to_value = $cmd_to;
    $id_focus = $preset_from_value == '' ? 'idFrom' : 'idTo';
    // Generate links for main menu and board markup (pieces)
    $board_encoded = encode_board($base_array);
    // Name parameter as code for who's player's term this is
    $p = $current_player == WHITES_MOVE ? GET_WHITE : GET_BLACK;
    $href_this = update_href();
    // get base link
    $href_this = update_href($href_this, GET_FROM, $preset_from_value);
    $href_this = update_href($href_this, GET_TO, $preset_to_value);
    $href_this = update_href($href_this, GET_PLAYER, $p);
    $href_this = update_href($href_this, GET_HISTORY, $history);
    $href_this = update_href($href_this, GET_WHITE, $name_white);
    $href_this = update_href($href_this, GET_BLACK, $name_black);
    $href_this = update_href($href_this, GET_EN_PASSANT, $get_en_passant);
    $href_this = update_href($href_this, GET_BASE_BOARD, $board_encoded);
    if ($flip_board) {
        $href_this = update_href($href_this, GET_FLIP_BOARD, '');
        $href_flip = update_href($href_this, GET_FLIP_BOARD, REMOVE_FROM_LINK);
    } else {
        $href_flip = update_href($href_this, GET_FLIP_BOARD, '');
    }
    if ($current_player == BLACKS_MOVE) {
        $href_player = update_href($href_this, GET_PLAYER, GET_WHITE);
    } else {
        $href_player = update_href($href_this, GET_PLAYER, GET_BLACK);
    }
    // HTTP redirect?
    if (!false && $redirect_after_move) {
        if (DEBUG) {
            #die( "Continue: <a href='$href_this'>$href_this</a>" );
        }
        // Game state has been updated. In case of an executed move,
        // the browser needs to reload the page with the updated URL:
        header('HTTP/1.0 303 Found');
        header('Location: ' . htmlspecialchars_decode($href_this));
        die;
    }
    // Create HTML markup
    // History
    $history_markup = history_markup($base_array, $history, $href_this, $name_white, $name_black, $game_status);
    // Promotion
    if ($promotion_popup) {
        $promotion_dialog_markup = promotion_dialog_markup($href_this, $current_player, $t_row, $t_col, $history);
        $clickable = $selected = array();
    } else {
        $promotion_dialog_markup = '';
    }
    // Board
    if (STEADY_BOARD && $current_player == BLACKS_MOVE) {
        //... GET switch
        $flip_board = !$flip_board;
    }
    if (isset($_GET[GET_GOTO])) {
        $clickable = $selected = array();
    } else {
        if ($history > '' && $cmd_from == $cmd_to) {
            if (substr($history, -4, 1) == '(') {
                // Skip promotion
                $selected[] = decode_field(substr($history, -3, 1));
                $selected[] = decode_field(substr($history, -6, 1));
            } else {
                // Normal move
                $selected[] = decode_field(substr($history, -2, 1));
                $selected[] = decode_field(substr($history, -1, 1));
            }
        }
    }
    $chess_board_markup = chess_board_markup($href_this, $board_array, $clickable, $selected, $current_player, $flip_board);
    // If no heading was set above, say who's next
    if ($goto != '') {
        $current_player = $goto % 2 != 0;
    }
    if ($heading == '') {
        $heading = $current_player ? $name_white : $name_black;
        $heading = ucfirst($heading) . "'";
        if (substr($heading, -2, 1) != 's') {
            $heading .= 's';
        }
        $heading .= ' move';
    }
    if (king_in_check($board_array, $current_player) && strpos($heading, 'mate') === false) {
        $heading .= ' - <strong>Check!</strong>';
    }
    if ($goto != '') {
        $turn_nr = goto_to_round($history, $goto);
        $heading = "Round {$turn_nr}, {$heading}";
    }
    $heading = get_parameter(GET_COMMENT, $heading);
    // Game title
    if (isset($_GET[GET_WHITE])) {
        $turn_nr = i_to_round($history);
        $game_title = "{$name_white} vs. {$name_black} - Turn #{$turn_nr} - ";
    }
    $turn_nr = floor($turn_nr);
    // History links
    $next_goto = ($goto + 1) % (count_moves($history) + 1);
    $history_next = update_href($href_this, GET_GOTO, $next_goto);
    $next_goto = ($goto + count_moves($history)) % (count_moves($history) + 1);
    $history_prev = update_href($href_this, GET_GOTO, $next_goto);
    // Links for copy and paste
    if (!isset($_GET[GET_NEW_GAME]) && !isset($_GET[GET_BASE_BOARD]) && isset($_SERVER['HTTP_REFERER']) && $_SERVER['QUERY_STRING'] != '' && $cmd_from == '' && $cmd_to == '') {
        // Empty referer: Not reached by clicking a link in the browser
        $t = str_replace('&amp;', '&', $href_this);
        $game_state_link = str_replace(' ', '+', $t);
        $home_IPs = array('192.168.14.1', '213.47.94.176', 'local.at');
        foreach ($home_IPs as $ip_address) {
            if (strpos($game_state_link, $ip_address) !== false) {
                $hmw_home_link = str_replace($ip_address, 'harald.ist.org/home', $game_state_link);
            }
        }
        if ($hmw_home_link != '') {
            $game_state_link = $hmw_home_link;
        }
        $game_state_link = str_replace('flip&', '', $game_state_link);
        $game_state_link = str_replace('&', '&amp;', $game_state_link);
    }
    debug_out("board_encoded = {$board_encoded}\n");
}
Example #8
0
    }
}
// Delete group
if ($delete_group) {
    $name = get_db_sql("SELECT nombre FROM tgrupo WHERE id_grupo = {$id}");
    $sql = sprintf('DELETE FROM tgrupo WHERE id_grupo = %d', $id);
    $result = process_sql($sql);
    if ($result === false) {
        echo '<h3 class="error">' . __('There was a problem deleting group') . '</h3>';
    } else {
        audit_db($config["id_user"], $config["REMOTE_ADDR"], "Group management", "Deleted group '{$name}'");
        echo '<h3 class="suc">' . __('Successfully deleted') . '</h3>';
    }
}
$offset = get_parameter("offset", 0);
$search_text = get_parameter("search_text", "");
echo "<table class='search-table' style='width: 99%;'><form name='bskd' method=post action='index.php?sec=users&sec2=godmode/grupos/lista_grupos'>";
echo "<td>";
echo "<b>" . __('Search text') . "</b>&nbsp;&nbsp;";
print_input_text("search_text", $search_text, '', 40, 0, false);
echo "</td>";
echo "<td>";
print_submit_button(__('Search'), '', false, 'class="sub next"', false, false);
echo "</td>";
echo "</table></form>";
$groups = get_db_all_rows_sql("SELECT * FROM tgrupo WHERE nombre LIKE '%{$search_text}%' ORDER BY nombre");
$groups = print_array_pagination($groups, "index.php?sec=users&sec2=godmode/grupos/lista_grupos");
print_groups_table($groups);
echo '<form method="post" action="index.php?sec=users&sec2=godmode/grupos/configurar_grupo">';
echo '<div class="button" style="width: ' . $table->width . '">';
print_submit_button(__('Create'), 'create_btn', false, 'class="sub next"');
Example #9
0
// GNU General Public License for more details.
global $config;
check_login();
require_once 'include/functions_tags.php';
if (!dame_admin($config["id_user"])) {
    audit_db("ACL Violation", $config["REMOTE_ADDR"], "No administrator access", "Trying to access setup");
    require "general/noaccess.php";
    exit;
}
echo "<h1>" . __("Tags management") . "</h1>";
// Tag info
$id = (int) get_parameter('id');
$name = (string) get_parameter('name');
$colour = (string) get_parameter('colour');
// Actions
$action = (string) get_parameter('action');
$create = $action === 'create';
$update = $action === 'update';
$delete = $action === 'delete';
if ($create || $update || $delete) {
    $crud_operation = array();
    $crud_operation['result'] = false;
    $crud_operation['message'] = '';
}
// Data processing
if ($create) {
    // name and colour required
    if (!empty($name) && !empty($colour)) {
        if (!exists_tag_name($name)) {
            try {
                $values = array(TAGS_TABLE_NAME_COL => $name, TAGS_TABLE_COLOUR_COL => $colour);
    $result = process_sql_update($external_table, $values, array($key => $key_value));
    if ($result) {
        echo "<h3 class='suc'>" . __('Updated row') . "</h3>";
    } else {
        echo "<h3 class='error'>" . __('There was a problem updating row') . "</h3>";
    }
}
if ($insert_row) {
    $fields = get_db_all_rows_sql("DESC " . $external_table);
    $key = get_parameter('key');
    if ($fields == false) {
        $fields = array();
    }
    foreach ($fields as $field) {
        if ($field['Field'] != $key) {
            $values[$field['Field']] = get_parameter($field['Field']);
        }
    }
    $result_insert = process_sql_insert($external_table, $values);
    if ($result_insert) {
        echo "<h3 class='suc'>" . __('Inserted row') . "</h3>";
    } else {
        echo "<h3 class='error'>" . __('There was a problem inserting row') . "</h3>";
    }
}
echo "<h1>" . __('External table management') . "</h1>";
$table->width = '98%';
$table->class = 'search-table';
$table->id = "external-editor";
$table->data = array();
$ext_tables = inventories_get_external_tables($id_object_type);
Example #11
0
    if (!$id) {
        echo '<h3 class="error">' . __('Could not be created') . '</h3>';
    } else {
        echo '<h3 class="suc">' . __('Successfully created') . '</h3>';
        //insert_event ("OBJECT TYPE CREATED", $id, 0, $name);
        audit_db($config["id_user"], $config["REMOTE_ADDR"], "Inventory Management", "Created object {$id} - {$name}");
    }
    $id = 0;
}
// Update
if ($update_object) {
    $name = (string) get_parameter("name");
    $icon = (string) get_parameter("icon");
    $min_stock = (int) get_parameter("min_stock");
    $description = (string) get_parameter("description");
    $show_in_list = (int) get_parameter("show_in_list");
    $sql = sprintf('UPDATE tobject_type SET name = "%s", icon = "%s", min_stock = %d,
		description = "%s", show_in_list = %d WHERE id = %s', $name, $icon, $min_stock, $description, $show_in_list, $id);
    $result = process_sql($sql);
    if (!$result) {
        echo "<h3 class='error'>" . __('Could not be updated') . "</h3>";
    } else {
        echo "<h3 class='suc'>" . __('Successfully updated') . "</h3>";
        //insert_event ("PRODUCT UPDATED", $id, 0, $name);
        audit_db($config["id_user"], $config["REMOTE_ADDR"], "Inventory Management", "Updated object {$id} - {$name}");
    }
}
// Delete
if ($delete_object) {
    // Move parent who has this product to 0
    $sql = sprintf('DELETE FROM tobject_type_field WHERE id_object_type = %d', $id);
Example #12
0
$labela = get_parameter("labela", "");
$labelb = get_parameter("labelb", "");
$valuea = get_parameter("a", 0);
$valueb = get_parameter("b", 0);
$valuec = get_parameter("c", 0);
$lite = get_parameter("lite", 0);
$date_from = get_parameter("date_from", 0);
$date_to = get_parameter("date_to", 0);
$mode = get_parameter("mode", 1);
$percent = get_parameter("percent", 0);
$days = get_parameter("days", 0);
$type = get_parameter("type", "");
$background = get_parameter("background", "#ffffff");
$id_incident = get_parameter("id_incident");
$period = get_parameter("period");
$ajax = get_parameter("is_ajax");
if ($type == "incident_a") {
    incident_peruser($width, $height);
} elseif ($type == "workunit_task") {
    graph_workunit_task($width, $height, $id_task);
} elseif ($type == "workunit_user") {
    graph_workunit_user($width, $height, $id_user, $date_from);
} elseif ($type == "workunit_project_user") {
    graph_workunit_project_user($width, $height, $id_user, $date_from, $date_to);
} elseif ($type == "project_tree") {
    project_tree($id_project, $id_user);
} elseif ($type == "all_project_tree") {
    all_project_tree($id_user, $completion, $project_kind);
} elseif ($type == "sla_slicebar") {
    if ($ajax) {
        echo graph_sla_slicebar($id_incident, $period, $width, $height);
Example #13
0
// 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; version 2
// 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.

if (check_login () != 0) {
	audit_db ("Noauth", $config["REMOTE_ADDR"], "No authenticated access","Trying to access ticket viewer");
	require ("general/noaccess.php");
	exit;
}

$id_incident = (int) get_parameter ('id');
$incidents = incidents_get_incident_childs ($id_incident, false);


if (count ($incidents) == 0) {
	echo ui_print_error_message (__('There\'s no tickets associated to this ticket'), '', true, 'h3', true);
}
else {
	
	$table = new StdClass();
	$table->class = 'listing';
	$table->width = '100%';
	$table->head = array ();
	$table->head[0] = __('ID');
	$table->head[1] = __('Name');
	$table->head[2] = __('Group');
Example #14
0
// as published by the Free Software Foundation; version 2
// 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.
global $config;
require_once 'include/functions_mail.php';
ob_clean();
$check_transport = (bool) get_parameter('check_transport');
$change_template_alert = (bool) get_parameter('change_template_alert');
if ($check_transport) {
    $proto = (string) get_parameter('proto');
    $host = (string) get_parameter('host');
    $port = (int) get_parameter('port');
    $user = (string) get_parameter('user');
    $pass = (string) get_parameter('pass');
    $transport_conf = array();
    if (!empty($host)) {
        $transport_conf['host'] = $host;
        if (!empty($port)) {
            $transport_conf['port'] = $port;
        }
        if (!empty($user)) {
            $transport_conf['user'] = $user;
        }
        if (!empty($pass)) {
            $transport_conf['pass'] = $pass;
        }
        if (!empty($proto)) {
            $transport_conf['proto'] = $proto;
        }
Example #15
0
function olc_seo_url($url)
{
    //W. Kaiser - Search friendly URLs
    if (USE_SEO) {
        $slash_pos = strrpos($url, SLASH);
        if ($slash_pos !== false) {
            $slash_pos++;
        }
        $pos = strrpos($url, QUESTION);
        if ($pos !== false) {
            $url_b = substr($url, 0, $pos);
            $parameters = substr($url, $pos + 1);
        } else {
            $url_b = $url;
            $parameters = EMPTY_STRING;
        }
        $url_b = basename($url_b);
        global $seo_urls_to_convert, $seo_action_parameter;
        //URLs are built like:
        //http://www.server.de/olcommerce/seo-processor-par1-val1-par2-val2-...-parn-valn.htm
        //e.g.: http://www.server.de/olcommerce/seo-products_info-products_id-144.htm
        global $seo_array_1, $seo_array_2;
        if (DO_SEO_EXTENDED) {
            global $seo_search, $seo_replace;
            $add_parameters = EMPTY_STRING;
            $processor_type = EMPTY_STRING;
            if ($url_b == FILENAME_PRODUCT_INFO) {
                $rewritten = true;
                $products_id = get_parameter($parameters, 'products_id', $add_parameters);
                if ($products_id) {
                    if (strpos($add_parameters, 'add_product') == false) {
                        $processor_type = 'p';
                    } else {
                        $processor_type = 'a';
                        $add_parameters = EMPTY_STRING;
                    }
                    $url_par = preg_replace($seo_search, $seo_replace, olc_get_products_name($products_id)) . SEMI_COLON . $products_id;
                }
            } elseif ($url_b == FILENAME_DEFAULT) {
                global $seo_categories;
                $check_parameter = 'BUYproducts_id';
                $products_id = get_parameter($parameters, $check_parameter, $add_parameters);
                if ($products_id) {
                    $processor_type = 'b';
                    $url_par = strtolower(olc_get_products_name($products_id, SESSION_LANGUAGE_ID));
                    $url_par = preg_replace($seo_search, $seo_replace, $url_par) . SEMI_COLON . $products_id;
                    $add_parameters = str_replace('action=buy_now', EMPTY_STRING, $add_parameters);
                    if ($add_parameters[0] == AMP) {
                        $add_parameters = substr($add_parameters, 1);
                    }
                } else {
                    $category_id = get_parameter($parameters, 'cPath', $add_parameters);
                    if ($category_id) {
                        $processor_type = 'k';
                        $url_par = EMPTY_STRING;
                        $category_id = explode(UNDERSCORE, $category_id);
                        $categories = sizeof($category_id);
                        for ($i = 0; $i < $categories; $i++) {
                            if ($url_par) {
                                $url_par .= SEO_SEPARATOR;
                            }
                            $url_par .= preg_replace($seo_search, $seo_replace, $seo_categories[$category_id[$i]]);
                        }
                    } else {
                        $manufacturer_id = get_parameter($parameters, 'manufacturers_id', $add_parameters);
                        if ($manufacturer_id) {
                            $processor_type = 'm';
                            $manufacturers = olc_get_manufacturers();
                            foreach ($manufacturers as $manufacturer_id) {
                                if ($manufacturer_id['id'] == $manufacturer_id) {
                                    $maname = $manufacturer_id['text'];
                                    break;
                                }
                            }
                            $url .= shopstat_hrefManulink($maname, $manufacturer_id, $url);
                        } else {
                            $filter_id = get_parameter($parameters, 'filter_id', $add_parameters);
                            if ($filter_id) {
                            } else {
                                //return $url;
                            }
                        }
                    }
                }
            } elseif ($url_b == FILENAME_CONTENT) {
                $content_id = get_parameter($parameters, 'coID', $add_parameters);
                if ($content_id) {
                    $processor_type = 'c';
                    $url_par = 'content' . SEMI_COLON . $content_id;
                }
            } else {
                //return $url;
            }
            if (!$processor_type) {
                /*
                $url_par=explode(PHP,$url);
                $url_par=$url_par[0];
                $pos=strrpos($url_par,SLASH);
                if ($pos!==false)
                {
                	$url_par=substr($url_par,$pos+1);
                	$processor_type='g';
                	if ($parameters)
                	{
                		$add_parameters=$parameters;
                	}
                }
                else
                {
                	return $url;
                }
                */
                return $url;
            }
            if ($processor_type) {
                $processor_type .= SEO_SEPARATOR;
            }
        } else {
            $url = str_replace($seo_array_1, SEO_SEPARATOR, str_replace($seo_array_2, SEO_SEPARATOR, $url));
            $url_par = EMPTY_STRING;
        }
        $url = str_replace(PHP, EMPTY_STRING, $url);
        if ($slash_pos === false) {
            $url = EMPTY_STRING;
        } else {
            $url = substr($url, 0, $slash_pos);
        }
        $url .= SEO_PAGENAME_START . $processor_type;
        $url .= $url_par . SEO_TERMINATOR;
        if ($add_parameters) {
            $url .= QUESTION . $add_parameters;
        }
    }
    return $url;
}
Example #16
0
function chess_board_markup($base_href, $board, $clickable, $selected, $player, $flip_board)
{
    $board_flipped = $player == WHITES_MOVE;
    if ($flip_board) {
        $board_flipped = !$board_flipped;
    }
    $pieces = get_pieces($board);
    $class = $player == WHITES_MOVE ? GET_WHITE : GET_BLACK;
    $class .= $flip_board ? ' flipped' : '';
    $html = "<table class=\"{$class}\">\n";
    // Create horizontal legend (A .. H) table row
    $legend = "<tr><th></th>";
    for ($row = 0; $row < 8; $row++) {
        $legend .= '<th>';
        if ($board_flipped) {
            $legend .= chr(ord('A') + $row);
        } else {
            $legend .= chr(ord('A') + (7 - $row));
        }
        $legend .= '</th>';
    }
    $legend .= "<th></th></tr>\n";
    $html .= $legend;
    // Create main part of the table
    for ($row = 0; $row < 8; $row++) {
        if ($board_flipped) {
            $row_name = 8 - $row;
        } else {
            $row_name = $row + 1;
        }
        // Start row with left legend
        $html .= "<tr><th>{$row_name}</th>\n";
        for ($col = 0; $col < 8; $col++) {
            if ($board_flipped) {
                $col_name = chr(ord('A') + $col);
            } else {
                $col_name = chr(ord('A') + (7 - $col));
            }
            $field_name = $col_name . $row_name;
            $class = in_array($field_name, $selected) ? ' class="selected"' : '';
            //$base_link
            $has_href = in_array($field_name, $clickable);
            if (get_parameter(GET_FROM) != get_parameter(GET_TO)) {
                $href = update_href($base_href, GET_TO, $field_name);
            } else {
                $href = update_href($base_href, GET_FROM, $field_name);
            }
            // Add TD for field
            $html .= "\t<td{$class}>";
            if ($has_href) {
                $html .= "<a href=\"{$href}\">";
            }
            $p = piece_in_field($pieces, $selected, $field_name);
            if ($p != '') {
                $html .= $p;
            } else {
                $html .= '.';
            }
            if ($has_href) {
                $html .= "</a>";
            }
            $html .= "</td>\n";
        }
        // Right legend, finalize row
        $html .= "<th>{$row_name}</th></tr>\n";
    }
    // Add second legend row and finalize
    $html .= "{$legend}</table>\n";
    return $html;
}
// as published by the Free Software Foundation; version 2
// 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.
global $config;
check_login();
if (!give_acl($config["id_user"], 0, "IM")) {
    audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access company section");
    require "general/noaccess.php";
    exit;
}
$id_incident_type = (int) get_parameter('id');
$add_field = (int) get_parameter('add_field');
$update_field = (int) get_parameter('update_field');
$id_field = (int) get_parameter('id_field');
$label = '';
$type = 'text';
$combo_value = '';
$linked_value = '';
$parent = '';
$show_in_list = false;
$global_field = false;
$add_linked_value = '';
if ($id_field) {
    $filter = array('id' => $id_field);
    $field_data = get_db_row_filter('tincident_type_field', $filter);
    if (!empty($field_data)) {
        $label = $field_data['label'];
        $type = $field_data['type'];
        $combo_value = $field_data['combo_value'];
Example #18
0
 $config["FOOTER_EMAIL"] = (string) get_parameter("footer_email", "");
 $config["HEADER_EMAIL"] = (string) get_parameter("header_email", "");
 $config["mail_from"] = (string) get_parameter("mail_from");
 $config["smtp_user"] = (string) get_parameter("smtp_user");
 $config["smtp_pass"] = (string) get_parameter("smtp_pass");
 $config["smtp_host"] = (string) get_parameter("smtp_host");
 $config["smtp_port"] = (string) get_parameter("smtp_port");
 $config["smtp_proto"] = (string) get_parameter("smtp_proto");
 $config["pop_user"] = (string) get_parameter("pop_user");
 $config["pop_pass"] = (string) get_parameter("pop_pass");
 $config["pop_host"] = (string) get_parameter("pop_host");
 $config["pop_port"] = (string) get_parameter("pop_port");
 $config["smtp_queue_retries"] = (int) get_parameter("smtp_queue_retries", 10);
 $config["max_pending_mail"] = get_parameter("max_pending_mail", 15);
 $config["batch_newsletter"] = get_parameter("batch_newsletter", 0);
 $config["select_pop_imap"] = get_parameter("select_pop_imap");
 update_config_token("HEADER_EMAIL", $config["HEADER_EMAIL"]);
 update_config_token("FOOTER_EMAIL", $config["FOOTER_EMAIL"]);
 update_config_token("notification_period", $config["notification_period"]);
 update_config_token("mail_from", $config["mail_from"]);
 update_config_token("smtp_port", $config["smtp_port"]);
 update_config_token("smtp_host", $config["smtp_host"]);
 update_config_token("smtp_user", $config["smtp_user"]);
 update_config_token("smtp_pass", $config["smtp_pass"]);
 update_config_token("smtp_proto", $config["smtp_proto"]);
 update_config_token("pop_host", $config["pop_host"]);
 update_config_token("pop_user", $config["pop_user"]);
 update_config_token("pop_pass", $config["pop_pass"]);
 update_config_token("pop_port", $config["pop_port"]);
 update_config_token("smtp_queue_retries", $config["smtp_queue_retries"]);
 update_config_token("max_pending_mail", $config["max_pending_mail"]);
Example #19
0
		
		//tree_search_submit()
		$table_search->data[3][1] = print_button(__('Export to CSV'), '', false, 'tree_search_submit(); window.open(\'' . 'include/export_csv.php?export_csv_inventory=1'.'\');', 'class="sub csv"', true);

		//button
		$table_search->data[3][2] = print_submit_button (__('Search'), 'search', false, 'class="sub search"', true);

		$search_other .= print_table($table_search, true);
		$search_other .= '</div>';
		
		print_container_div("inventory_form",__("Inventory form search"),$search_other, 'open', false, false);
	echo '</form>';
}

$write_permission = enterprise_hook ('inventory_check_acl', array ($config['id_user'], $id, true));	
$page = (int)get_parameter('page', 1);

switch ($mode) {
	case 'tree':
		echo '<div class = "inventory_tree_table" id = "inventory_tree_table">';
			inventories_print_tree($sql_search_pagination, $last_update);
		echo '</div>';
		break;
	case 'list':
		echo '<div id="tmp_data"></div>';
		echo '<div class = "inventory_list_table" id = "inventory_list_table">';
			echo '<div id= "inventory_only_table">';
				inventories_show_list2($sql_search, $sql_search_count, $params, $block_size, 0, $count_object_custom_fields, $sql_search_pagination);
			echo '</div>';
		echo '</div>';
		break;
// Copyright (c) 2007-2008 Artica Soluciones Tecnologicas
// Copyright (c) 2007-2008 Esteban Sanchez, estebans@artica.es

// 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; version 2
// 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.

global $config;

check_login ();

$id = (int) get_parameter ('id');

$is_enterprise = false;

if (file_exists ("enterprise/include/functions_inventory.php")) {
	require_once ("enterprise/include/functions_inventory.php");
	$is_enterprise = true;
}

$write_permission = true;

if ($is_enterprise) {
	$read_permission = inventory_check_acl($config['id_user'], $id);

	$write_permission = inventory_check_acl($config['id_user'], $id, true);
// GNU General Public License for more details.
global $config;

check_login ();

$filter['limit'] = 0;
$incidents = filter_incidents ($filter);

unset($filter['limit']);

/* Add a form to carry filter between statistics and search views */
echo '<form id="search_form" method="post" action="index.php?sec=incidents&sec2=operation/incidents/incident_search&option=search" style="clear: both">';
foreach ($filter as $key => $value) {
	print_input_hidden ("search_".$key, $value);
}
print_input_hidden ("offset", get_parameter("offset"));
echo "</form>";

/* Add a form to generate HTML reports */
echo '<form id="html_report_form" method="post" target="_blank" action="index.php" style="clear: both">';
foreach ($filter as $key => $value) {
	print_input_hidden ("search_".$key, $value);
}

print_input_hidden ('sec2', 'operation/reporting/incidents_html');
print_input_hidden ('clean_output', 1);
echo "</form>";

/* Add a form to generate HTML reports */
echo '<form id="pdf_report_form" method="post" target="_blank" action="index.php" style="clear: both">';
foreach ($filter as $key => $value) {
	}
}

if ($id) {
	clean_cache_db();

	$report = get_db_row ('tinventory_reports', 'id', $id);
	if ($report === false)
		return;
	$name = $report['name'];
	$sql = $report['sql'];
	$id_group = $report['id_group'];
}

$render = get_parameter ("render",0);
$render_html = get_parameter ("render_html",0);

if ($render == 1){

	$search = array();
	
	//$search[] = "&#x0d;";
	$search[] = "\r";
	//$search[] = "&#x0a;";
	$search[] = "\n";
	$search[] = '"';
	$search[] = "'";
	//$search[] = ";";
	$search[] = ",";

	$report = get_db_row ('tinventory_reports', 'id', $id);
Example #23
0
    //Clean name output
    foreach ($events as $ev) {
        $ev["name"] = safe_output($ev["name"]);
        array_push($events_result, $ev);
    }
    echo json_encode($events_result);
    return;
}
if ($get_holidays) {
    $start_date = get_parameter("start_date");
    $end_date = get_parameter("end_date");
    $id_user = get_parameter("id_user", "");
    if (!$id_user) {
        $users = get_user_visible_users($config["id_user"]);
        $users_ids = array_keys($users);
    } else {
        $users_ids = $id_user;
    }
    $holidays = calendar_get_users_holidays_date_range($start_date, $end_date, $users_ids);
    echo json_encode($holidays);
    return;
}
if ($get_non_working_days) {
    $year = safe_output(get_parameter("year"));
    $result = calendar_get_non_working_days($year);
    echo json_encode($result);
    return;
}
?>
 	
Example #24
0
$date = date('Y-m-d');


// --------------------
// Workunit report (yearly)
// --------------------
//	$now = date("Y-m-d H:i:s");
$year = date("Y");

$year = get_parameter ("year", $year);

$prev_year = $year -1 ;
$next_year = $year +1 ;	


$id_user_show = get_parameter ("id_user", $config["id_user"]);

if (($id_user_show != $config["id_user"]) AND (!give_acl($config["id_user"], 0, "PM"))){
	// Doesn't have access to this page
	audit_db($id_user, $config["REMOTE_ADDR"], "ACL Violation","Trying to access to another user yearly report without proper rights");
	include ("general/noaccess.php");
	exit;
}


// Extended ACL check for project manager
// TODO - Move to enteprrise, encapsulate in a general function
$users = get_user_visible_users();

if (($id_user_show == "") || (($id_user_show != $config["id_user"]) && !in_array($id_user_show, array_keys($users)))) {
		audit_db("Noauth", $config["REMOTE_ADDR"], "No permission access", "Trying to access user workunit report");
	include ("general/noaccess.php");
	exit;
}

//Clean output we need to print incident title header :)
if ($clean_output) {
	echo '<h1 class="ticket_clean_report_title">'.__("Statistics")."</h1>";
}

$fields = array(SECONDS_1DAY => "1 day",
				SECONDS_2DAY => "2 days",
				SECONDS_1WEEK => "1 week",
				SECONDS_2WEEK => "2 weeks",
				SECONDS_1MONTH => "1 month");

$period = get_parameter("period", SECONDS_1DAY);
$ttl = 1;

if ($clean_output) {
	$ttl = 2;
}

$stats = incidents_get_incident_stats($id);

if (!$stats) {
	echo "<table width='100%'>";
		echo "<tr>";
			echo "<td style='vertical-align:top; width: 33%;'>";
			echo __("There isn't statistics for this ticket");
			echo "</td>";
		echo "</tr>";
if ($delete_link) {
	$id_src = get_parameter('id_src');
	$id_dst = get_parameter('id_dst');

	$result = process_sql_delete ('tinventory_relationship', array ('id_object_src' => $id_src, 'id_object_dst' => $id_dst));
	
	if ($result) {
		echo ui_print_success_message (__("Inventory relationship deleted"), '', true, 'h3', true);
	} else {
		echo ui_print_error_message (__("Error deleting inventory relationship"), '', true, 'h3', true);
	}
}

if ($add_link) {
	$id_dst = get_parameter('link', 0);
	$id_src = get_parameter('id_src');
		
	$sql = "INSERT INTO tinventory_relationship (id_object_src, id_object_dst) VALUES ($id_src, $id_dst)";
	$result = process_sql($sql);
	
	if ($result) {
		echo ui_print_success_message (__("Inventory relationship added"), '', true, 'h3', true);
	} else {
		echo ui_print_error_message (__("Error adding inventory relationship"), '', true, 'h3', true);
	}
}

$sql_links = "SELECT * FROM tinventory_relationship 
			WHERE `id_object_src`=$id OR `id_object_dst`=$id";
			
$all_links = get_db_all_rows_sql($sql_links);
Example #27
0
    echo "<input type=text name='email' size=25>";
    $bool = rand(1, 1000);
    echo "<td>";
    echo "<input type=submit value='" . __("Desubscribe me") . "'>";
    echo "<input type=hidden name='validation1' value='" . md5($config["dbpass"] . $bool) . "'>";
    echo "<input type=hidden name='validation2' value='{$bool}'>";
    echo "<input type=hidden name='operation' value='desubscribe_data'>";
    echo "<input type=hidden name='newsletter' value='{$id}'>";
    echo "</table></form>";
    return;
}
if ($operation == "desubscribe_data") {
    $validation1 = get_parameter("validation1");
    $validation2 = get_parameter("validation2");
    $newsletter = get_parameter("newsletter");
    $email = get_parameter("email");
    $now = date("Y-m-d H:i:s");
    if ($validation1 == md5($config["dbpass"] . $validation2)) {
        // check if already subscribed
        $count = get_db_sql("SELECT COUNT(id) FROM tnewsletter_address WHERE status = 0 AND email = '" . $email . "' AND id_newsletter = {$newsletter}");
        if ($count > 0) {
            $sql = "UPDATE tnewsletter_address SET status=1 WHERE id_newsletter = {$newsletter} AND email = '" . $email . "'";
            $result = mysql_query($sql);
            if ($result) {
                sleep(5);
                // Robot protection
                echo "<h3>" . __("You has been desubscribed. Thanks!") . "</h3>";
            }
        } else {
            sleep(5);
            // Robot protection
Example #28
0
 $config["access_protocol"] = get_parameter("access_protocol");
 $config["access_port"] = get_parameter("access_port", "");
 $config["access_public"] = get_parameter("access_public", $_SERVER["SERVER_NAME"]);
 $config["loginhash_pwd"] = get_parameter("loginhash_pwd", "");
 $config["csv_standard_encoding"] = (int) get_parameter("csv_standard_encoding");
 $config["enable_update_manager"] = get_parameter("enable_update_manager");
 $config["max_direct_download"] = get_parameter("max_direct_download");
 if ($is_enterprise) {
     $config["enable_pass_policy"] = get_parameter("enable_pass_policy", 0);
     $config["pass_size"] = get_parameter("pass_size", 4);
     $config["pass_needs_numbers"] = get_parameter("pass_needs_numbers", 0);
     $config["pass_needs_symbols"] = get_parameter("pass_needs_symbols", 0);
     $config["pass_expire"] = get_parameter("pass_expire", 0);
     $config["first_login"] = get_parameter("first_login", 1);
     $config["mins_fail_pass"] = get_parameter("mins_fail_pass", 5);
     $config["number_attempts"] = get_parameter("number_attempts", 5);
 }
 update_config_token("timezone", $config["timezone"]);
 //TODO: Change all "process_sqlxxx" for update_config_token in following code:
 update_config_token("language_code", $config["language_code"]);
 update_config_token("sitename", $config["sitename"]);
 update_config_token("max_file_size", $config["max_file_size"]);
 process_sql("DELETE FROM tconfig WHERE token = 'incident_reporter'");
 process_sql("INSERT INTO tconfig (token, value) VALUES ('incident_reporter', '" . $config["incident_reporter"] . "')");
 update_config_token("api_acl", $config["api_acl"]);
 update_config_token("api_password", $config["api_password"]);
 update_config_token("error_log", $config["error_log"]);
 update_config_token("first_day_week", $config["first_day_week"]);
 update_config_token("access_protocol", $config["access_protocol"]);
 update_config_token("access_port", $config["access_port"]);
 update_config_token("url_updatemanager", $config["url_updatemanager"]);
Example #29
0
$write_permission = check_crm_acl('lead', 'cw', $config['id_user'], $id);
$manage_permission = check_crm_acl('lead', 'cm', $config['id_user'], $id);
if (!$write_permission && !$manage_permission) {
    audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to a lead forward");
    include "general/noaccess.php";
    exit;
}
$lead = get_db_row('tlead', 'id', $id);
$user = get_db_row("tusuario", "id_usuario", $config["id_user"]);
$company_user = get_db_sql("select name FROM tcompany where id = " . $user["id_company"]);
$from = get_parameter("from", $user["direccion"]);
$to = get_parameter("to", "");
$subject = get_parameter("subject", "");
$mail = get_parameter("mail", "");
$send = (int) get_parameter("send", 0);
$cco = get_parameter("cco", "");
// Send mail
if ($send) {
    if ($subject != "" and $from != "" and $to != "") {
        echo "<h3 class='suc'>" . __('Mail queued') . "</h3>";
        integria_sendmail($to, $subject, $mail, false, "", $from, true);
        if ($cco != "") {
            integria_sendmail($cco, $subject, $mail, false, "", $from, true);
        }
        $datetime = date("Y-m-d H:i:s");
        // Update tracking
        $sql = sprintf('INSERT INTO tlead_history (id_lead, id_user, timestamp, description) VALUES (%d, "%s", "%s", "%s")', $id, $config["id_user"], $datetime, "Forwarded lead by mail to {$to}");
        process_sql($sql);
        // Update activity
        $comments = __("Forwarded lead by mail to {$to}") . "&#x0d;&#x0a;" . $mail;
        // this adds &#x0d;&#x0a;
Example #30
0
 $config["smtp_host"] = (string) get_parameter("smtp_host");
 $config["smtp_port"] = (string) get_parameter("smtp_port");
 $config["news_smtp_user"] = (string) get_parameter("news_smtp_user");
 $config["news_smtp_pass"] = (string) get_parameter("news_smtp_pass");
 $config["news_smtp_host"] = (string) get_parameter("news_smtp_host");
 $config["news_smtp_port"] = (string) get_parameter("news_smtp_port");
 $config["pop_user"] = (string) get_parameter("pop_user");
 $config["pop_pass"] = (string) get_parameter("pop_pass");
 $config["pop_host"] = (string) get_parameter("pop_host");
 $config["pop_port"] = (string) get_parameter("pop_port");
 $config["smtp_queue_retries"] = (int) get_parameter("smtp_queue_retries", 10);
 $config["max_pending_mail"] = get_parameter("max_pending_mail", 15);
 $config["batch_newsletter"] = get_parameter("batch_newsletter", 0);
 $config["news_batch_newsletter"] = get_parameter("news_batch_newsletter", 0);
 $config["batch_email_validation"] = get_parameter("batch_email_validation", 0);
 $config["active_validate"] = get_parameter("active_validate", 0);
 update_config_token("HEADER_EMAIL", $config["HEADER_EMAIL"]);
 update_config_token("FOOTER_EMAIL", $config["FOOTER_EMAIL"]);
 update_config_token("notification_period", $config["notification_period"]);
 update_config_token("mail_from", $config["mail_from"]);
 update_config_token("smtp_port", $config["smtp_port"]);
 update_config_token("smtp_host", $config["smtp_host"]);
 update_config_token("smtp_user", $config["smtp_user"]);
 update_config_token("smtp_pass", $config["smtp_pass"]);
 update_config_token("news_smtp_port", $config["news_smtp_port"]);
 update_config_token("news_smtp_host", $config["news_smtp_host"]);
 update_config_token("news_smtp_user", $config["news_smtp_user"]);
 update_config_token("news_smtp_pass", $config["news_smtp_pass"]);
 update_config_token("pop_host", $config["pop_host"]);
 update_config_token("pop_user", $config["pop_user"]);
 update_config_token("pop_pass", $config["pop_pass"]);