Ejemplo n.º 1
0
/**
 * Generates directories list.
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 * @return void
 */
function client_generateDirectoriesList($tpl)
{
    // Initialize variables
    $path = isset($_GET['cur_dir']) ? clean_input($_GET['cur_dir']) : '';
    $domain = $_SESSION['user_logged'];
    // Create the virtual file system and open it so it can be used
    $vfs = new iMSCP_VirtualFileSystem($domain);
    // Get the directory listing
    $list = $vfs->ls($path);
    if (!$list) {
        set_page_message(tr('Unable to retrieve directories list for your domain. Please contact your reseller.'), 'error');
        $tpl->assign('FTP_CHOOSER', '');
        return;
    }
    // Show parent directory link
    $parent = explode('/', $path);
    array_pop($parent);
    $parent = implode('/', $parent);
    $tpl->assign(array('ACTION_LINK' => '', 'ACTION' => '', 'ICON' => 'parent', 'DIR_NAME' => tr('Parent directory'), 'LINK' => "ftp_choose_dir.php?cur_dir={$parent}"));
    $tpl->parse('DIR_ITEM', '.dir_item');
    // Show directories only
    foreach ($list as $entry) {
        $directory = $path . '/' . $entry['file'];
        if ($entry['type'] != iMSCP_VirtualFileSystem::VFS_TYPE_DIR || ($entry['file'] == '.' || $entry['file'] == '..') || !isAllowedDir(get_user_domain_id($_SESSION['user_id']), $directory)) {
            continue;
        }
        // Create the directory link
        $tpl->assign(array('DIR_NAME' => tohtml($entry['file']), 'CHOOSE_IT' => $directory, 'LINK' => 'ftp_choose_dir.php?cur_dir=' . $directory));
        $tpl->parse('ACTION_LINK', 'action_link');
        $tpl->parse('DIR_ITEM', '.dir_item');
    }
}
Ejemplo n.º 2
0
    $requirements['environment']['shell'] = 0;
    $reqMessages[1][] = installer_t('The "mysqldump" and "mysql" command line utilities are unavailable on this system. X2Engine will not be able to automatically make a backup of its database during software updates, or automatically restore its database in the event of a failed update.');
}
$giNotwork = installer_t('Google integration will not work.');
if (!function_exists('sys_get_temp_dir')) {
    $message = installer_t('The function "sys_get_temp_dir" is unavailable.');
    if (isAllowedDir('/tmp')) {
        if (!is_writable('/tmp')) {
            $reqMessages[1][] = $msg . ' ' . installer_t('The directory "/tmp" is not writable.') . ' ' . $giNotwork;
        }
    } else {
        $reqMessages[1][] = $msg . ' ' . installer_t('Use of the directory "/tmp" is not permitted on this system.') . ' ' . $giNotwork;
    }
} else {
    $tmp = sys_get_temp_dir();
    if (!empty($tmp) && isAllowedDir($tmp)) {
        if (!is_writable($tmp)) {
            $reqMessages[1][] = installer_t('The system temporary directory, according to "sys_get_temp_dir", is not writable.') . ' ' . $giNotwork;
        }
    } else {
        $reqMessages[1][] = installer_t('Usage of the system temporary directory, according to "sys_get_temp_dir", is either unknown or not permitted.') . ' ' . $giNotwork;
    }
}
////////////////////////////////////////////////////////////
// LOW PRIORITY: MISCELLANEOUS FUNCTIONALITY REQUIREMENTS //
////////////////////////////////////////////////////////////
// Check encryption methods
if (!($requirements['extensions']['openssl'] = extension_loaded('openssl') && ($requirements['extensions']['mcrypt'] = extension_loaded('mcrypt')))) {
    $reqMessages[1][] = installer_t('The "openssl" and "mcrypt" libraries are not available. If any application credentials (i.e. email account passwords) are entered into X2Engine, they  will be stored in the database in plain text (without any encryption whatsoever). Thus, if the database is ever compromised, those passwords will be readable by unauthorized parties.');
}
// Check for Zip extension