Exemplo n.º 1
0
$page_title = __('Manage files', 'cftp_admin');
$current_level = get_current_user_level();
/**
 * Used to distinguish the current page results.
 * Global means all files.
 * Client or group is only when looking into files
 * assigned to any of them.
 */
$results_type = 'global';
/**
 * The client's id is passed on the URI.
 * Then get_client_by_id() gets all the other account values.
 */
if (isset($_GET['client_id'])) {
    $this_id = $_GET['client_id'];
    $this_client = get_client_by_id($this_id);
    /** Add the name of the client to the page's title. */
    if (!empty($this_client)) {
        $page_title .= ' ' . __('for client', 'cftp_admin') . ' ' . html_entity_decode($this_client['name']);
        $search_on = 'client_id';
        $name_for_actions = $this_client['username'];
        $results_type = 'client';
    }
}
/**
 * The group's id is passed on the URI also.
 */
if (isset($_GET['group_id'])) {
    $this_id = $_GET['group_id'];
    $sql_name = $dbh->prepare("SELECT name from " . TABLE_GROUPS . " WHERE id=:id");
    $sql_name->bindParam(':id', $this_id, PDO::PARAM_INT);
Exemplo n.º 2
0
/**
 * If the form was submited with errors, show them here.
 */
$valid_me->list_errors();
?>
		
		<?php 
if (isset($edit_response)) {
    /**
     * Get the process state and show the corresponding ok or error message.
     */
    switch ($edit_response['query']) {
        case 1:
            $msg = __('Client edited correctly.', 'cftp_admin');
            echo system_message('ok', $msg);
            $saved_client = get_client_by_id($client_id);
            /** Record the action log */
            $new_log_action = new LogActions();
            $log_action_args = array('action' => 14, 'owner_id' => $global_id, 'affected_account' => $client_id, 'affected_account_name' => $saved_client['username'], 'get_user_real_name' => true);
            $new_record_action = $new_log_action->log_action_save($log_action_args);
            break;
        case 0:
            $msg = __('There was an error. Please try again.', 'cftp_admin');
            echo system_message('error', $msg);
            break;
    }
} else {
    /**
     * If not $edit_response is set, it means we are just entering for the first time.
     */
    $direct_access_error = __('This page is not intended to be accessed directly.', 'cftp_admin');