Exemplo n.º 1
0
            default:
                $actions = tr('n\\a');
        }
        $row['actions'] = $actions;
        $output['aaData'][] = $row;
    }
    return $output;
}
/***********************************************************************************************************************
 * Main
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
check_login('reseller');
resellerHasFeature('domain_aliases') or showBadRequestErrorPage();
if (is_xhr()) {
    header('Cache-Control: no-cache, must-revalidate');
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
    header('Content-type: application/json');
    header('Status: 200 OK');
    echo json_encode(reseller_getDatatable());
    exit;
}
/** @var $tpl iMSCP_pTemplate */
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'reseller/alias.tpl', 'page_message' => 'layout', 'als_add_button' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Reseller / Customers / Domain Aliases'), 'TR_ALIAS_NAME' => tr('Domain alias name'), 'TR_MOUNT_POINT' => tr('Mount point'), 'TR_FORWARD_URL' => tr('Forward URL'), 'TR_STATUS' => tr('Status'), 'TR_CUSTOMER' => tr('Customer'), 'TR_ACTIONS' => tr('Actions'), 'TR_ADD_DOMAIN_ALIAS' => tr('Add domain alias'), 'TR_MESSAGE_DELETE_ALIAS' => tr('Are you sure you want to delete the %s domain alias?', '%s'), 'TR_MESSAGE_DELETE_ALIAS_ORDER' => tr('Are you sure you want to delete the %s domain alias order?', '%s'), 'TR_PROCESSING_DATA' => tr('Processing...')));
iMSCP_Events_Aggregator::getInstance()->registerListener('onGetJsTranslations', function ($e) {
    /** @var $e \iMSCP_Events_Event */
    $e->getParam('translations')->core['dataTable'] = getDataTablesPluginTranslations(false);
Exemplo n.º 2
0
        send_request();
        write_log(sprintf('New domain alias `%s` has been added by %', $domainAliasName, $_SESSION['user_logged']), E_USER_NOTICE);
        set_page_message(tr('Domain alias successfully scheduled for addition.'), 'success');
    } catch (iMSCP_Exception_Database $e) {
        $db->rollBack();
        throw $e;
    }
    return true;
}
/***********************************************************************************************************************
 * Main
 */
require_once 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
check_login('reseller');
resellerHasFeature('domain_aliases') && resellerHasCustomers() or showBadRequestErrorPage();
if (is_xhr() && isset($_POST['customer_id'])) {
    echo getJsonDomainsList(clean_input($_POST['customer_id']));
    return;
}
$resellerProps = imscp_getResellerProperties($_SESSION['user_id']);
if ($resellerProps['max_als_cnt'] != 0 && $resellerProps['current_als_cnt'] >= $resellerProps['max_als_cnt']) {
    set_page_message(tr('You have reached the maximum number of domain aliasses allowed by your subscription.'), 'warning');
    redirectTo('users.php');
}
if (!empty($_POST) && addDomainAlias()) {
    redirectTo('alias.php');
}
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'reseller/alias_add.tpl', 'page_message' => 'layout', 'customer_option' => 'page', 'shared_mount_point_domain' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Reseller / Domains / Add Domain Alias'), 'TR_CUSTOMER_ACCOUNT' => tr('Customer account'), 'TR_DOMAIN_ALIAS' => tr('Domain alias'), 'TR_DOMAIN_ALIAS_NAME' => tr('Domain alias name'), 'TR_DOMAIN_ALIAS_NAME_TOOLTIP' => tr("You must omit 'www'. It will be added automatically."), 'TR_SHARED_MOUNT_POINT' => tr('Shared mount point'), 'TR_SHARED_MOUNT_POINT_TOOLTIP' => tr('Allows to share the mount point of another domain.'), 'TR_URL_FORWARDING' => tr('URL forwarding'), 'TR_URL_FORWARDING_TOOLTIP' => tr('Allows to forward any request made to this domain alias to a specific URL. Be aware that when this option is in use, no Web folder is created for the domain alias.'), 'TR_FORWARD_TO_URL' => tr('Forward to URL'), 'TR_YES' => tr('Yes'), 'TR_NO' => tr('No'), 'TR_HTTP' => 'http://', 'TR_HTTPS' => 'https://', 'TR_FTP' => 'ftp://', 'TR_ADD' => tr('Add'), 'TR_CANCEL' => tr('Cancel')));
Exemplo n.º 3
0
 *
 * Portions created by the ispCP Team are Copyright (C) 2006-2010 by
 * isp Control Panel. All Rights Reserved.
 *
 * Portions created by the i-MSCP Team are Copyright (C) 2010-2015 by
 * i-MSCP - internet Multi Server Control Panel. All Rights Reserved.
 */
/************************************************************************************
 * Main script
 */
// Include core library
require_once 'imscp-lib.php';
require_once LIBRARY_PATH . '/Functions/Tickets.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
check_login('reseller');
resellerHasFeature('support') or showBadRequestErrorPage();
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$userId = $_SESSION['user_id'];
// Checks if support ticket system is activated and if the reseller can access to it
if (!hasTicketSystem($userId)) {
    redirectTo('index.php');
} elseif (isset($_GET['ticket_id']) && !empty($_GET['ticket_id'])) {
    reopenTicket((int) $_GET['ticket_id']);
}
if (isset($_GET['psi'])) {
    $start = $_GET['psi'];
} else {
    $start = 0;
}
$tpl = new iMSCP_pTemplate();
Exemplo n.º 4
0
/**
 * Check input data
 *
 * @return bool TRUE if data are valid, FALSE otherwise
 */
function checkInputData()
{
    global $name, $description, $sub, $als, $mail, $mailQuota, $ftp, $sqld, $sqlu, $traffic, $diskSpace, $php, $cgi, $dns, $backup, $aps, $extMail, $webFolderProtection, $status;
    $name = isset($_POST['name']) ? clean_input($_POST['name']) : $name;
    $description = isset($_POST['description']) ? clean_input($_POST['description']) : $description;
    $sub = isset($_POST['sub']) ? clean_input($_POST['sub']) : $sub;
    $als = isset($_POST['als']) ? clean_input($_POST['als']) : $als;
    $mail = isset($_POST['mail']) ? clean_input($_POST['mail']) : $mail;
    $mailQuota = isset($_POST['mail_quota']) ? clean_input($_POST['mail_quota']) : $mailQuota;
    $ftp = isset($_POST['ftp']) ? clean_input($_POST['ftp']) : $ftp;
    $sqld = isset($_POST['sql_db']) ? clean_input($_POST['sql_db']) : $sqld;
    $sqlu = isset($_POST['sql_user']) ? clean_input($_POST['sql_user']) : $sqlu;
    $traffic = isset($_POST['traff']) ? clean_input($_POST['traff']) : $traffic;
    $diskSpace = isset($_POST['disk']) ? clean_input($_POST['disk']) : $diskSpace;
    $php = isset($_POST['php']) ? clean_input($_POST['php']) : $php;
    $cgi = isset($_POST['cgi']) ? clean_input($_POST['cgi']) : $cgi;
    $dns = isset($_POST['dns']) ? clean_input($_POST['dns']) : $dns;
    $backup = isset($_POST['backup']) && is_array($_POST['backup']) ? $_POST['backup'] : $backup;
    $aps = isset($_POST['softwares_installer']) ? clean_input($_POST['softwares_installer']) : $aps;
    $extMail = isset($_POST['external_mail']) ? clean_input($_POST['external_mail']) : $extMail;
    $webFolderProtection = isset($_POST['protected_webfolders']) ? clean_input($_POST['protected_webfolders']) : $webFolderProtection;
    $status = isset($_POST['status']) ? clean_input($_POST['status']) : $status;
    $php = $php === '_yes_' ? '_yes_' : '_no_';
    $cgi = $cgi === '_yes_' ? '_yes_' : '_no_';
    $dns = resellerHasFeature('custom_dns_records') && $dns === '_yes_' ? '_yes_' : '_no_';
    $backup = resellerHasFeature('backup') ? array_intersect($backup, array('_dmn_', '_sql_', '_mail_')) : array();
    $aps = resellerHasFeature('aps') && $aps === '_yes_' ? '_yes_' : '_no_';
    $extMail = $extMail === '_yes_' ? '_yes_' : '_no_';
    $webFolderProtection = $webFolderProtection === '_yes_' ? '_yes_' : '_no_';
    $errFieldsStack = array();
    if ($aps == '_yes_') {
        // Ensure that PHP is enabled when software installer is enabled
        $php = '_yes_';
    }
    if ($name === '') {
        set_page_message(tr('Name cannot be empty.'), 'error');
        $errFieldsStack[] = 'name';
    }
    if ($description === '') {
        set_page_message(tr('Description cannot be empty.'), 'error');
        $errFieldsStack[] = 'description';
    }
    if (!resellerHasFeature('subdomains')) {
        $sub = '-1';
    } elseif (!imscp_limit_check($sub, -1)) {
        set_page_message(tr('Incorrect subdomain limit.'), 'error');
        $errFieldsStack[] = 'sub';
    }
    if (!resellerHasFeature('domain_aliases')) {
        $als = '-1';
    } elseif (!imscp_limit_check($als, -1)) {
        set_page_message(tr('Incorrect domain alias limit.'), 'error');
        $errFieldsStack[] = 'als';
    }
    if (!resellerHasFeature('mail')) {
        $mail = '-1';
    } elseif (!imscp_limit_check($mail, -1)) {
        set_page_message(tr('Incorrect email account limit.'), 'error');
        $errFieldsStack[] = 'mail';
    }
    if (!resellerHasFeature('ftp')) {
        $ftp = '-1';
    } elseif (!imscp_limit_check($ftp, -1)) {
        set_page_message(tr('Incorrect FTP account limit.'), 'error');
        $errFieldsStack[] = 'ftp';
    }
    if (!resellerHasFeature('sql_db')) {
        $sqld = '-1';
    } elseif (!imscp_limit_check($sqld, -1)) {
        set_page_message(tr('Incorrect SQL database limit.'), 'error');
        $errFieldsStack[] = 'sql_db';
    } elseif ($sqlu != -1 && $sqld == -1) {
        set_page_message(tr('SQL user limit is <i>disabled</i>.'), 'error');
        $errFieldsStack[] = 'sql_db';
        $errFieldsStack[] = 'sql_user';
    }
    if (!resellerHasFeature('sql_user')) {
        $sqlu = '-1';
    } elseif (!imscp_limit_check($sqlu, -1)) {
        set_page_message(tr('Incorrect SQL user limit.'), 'error');
        $errFieldsStack[] = 'sql_user';
    } elseif ($sqlu == -1 && $sqld != -1) {
        set_page_message(tr('SQL database limit is not <i>disabled</i>.'), 'error');
        $errFieldsStack[] = 'sql_user';
        $errFieldsStack[] = 'sql_db';
    }
    if (!imscp_limit_check($traffic, null)) {
        set_page_message(tr('Incorrect monthly traffic limit.'), 'error');
        $errFieldsStack[] = 'traff';
    }
    if (!imscp_limit_check($diskSpace, null)) {
        set_page_message(tr('Incorrect disk space limit.'), 'error');
        $errFieldsStack[] = 'disk';
    }
    if (!imscp_limit_check($mailQuota, null)) {
        set_page_message(tr('Wrong syntax for the mail quota value.'), 'error');
        $errFieldsStack[] = 'mail_quota';
    } elseif ($diskSpace != 0 && $mailQuota > $diskSpace) {
        set_page_message(tr('Email quota cannot be bigger than disk space limit.'), 'error');
        $errFieldsStack[] = 'mail_quota';
    } elseif ($diskSpace != 0 && $mailQuota == 0) {
        set_page_message(tr('Email quota cannot be unlimited. Max value is %d MiB.', $diskSpace), 'error');
        $errFieldsStack[] = 'mail_quota';
    }
    $phpini = iMSCP_PHPini::getInstance();
    if (isset($_POST['php_ini_system']) && $php != '_no_' && $phpini->resellerHasPermission('phpiniSystem')) {
        $phpini->setClientPermission('phpiniSystem', clean_input($_POST['php_ini_system']));
        if ($phpini->clientHasPermission('phpiniSystem')) {
            if (isset($_POST['phpini_perm_allow_url_fopen'])) {
                $phpini->setClientPermission('phpiniAllowUrlFopen', clean_input($_POST['phpini_perm_allow_url_fopen']));
            }
            if (isset($_POST['phpini_perm_display_errors'])) {
                $phpini->setClientPermission('phpiniDisplayErrors', clean_input($_POST['phpini_perm_display_errors']));
            }
            if (isset($_POST['phpini_perm_disable_functions'])) {
                $phpini->setClientPermission('phpiniDisableFunctions', clean_input($_POST['phpini_perm_disable_functions']));
            }
            if (isset($_POST['phpini_perm_mail_function'])) {
                $phpini->setClientPermission('phpiniMailFunction', clean_input($_POST['phpini_perm_mail_function']));
            }
            if (isset($_POST['memory_limit'])) {
                // Must be set before phpiniPostMaxSize
                $phpini->setDomainIni('phpiniMemoryLimit', clean_input($_POST['memory_limit']));
            }
            if (isset($_POST['post_max_size'])) {
                // Must be set before phpiniUploadMaxFileSize
                $phpini->setDomainIni('phpiniPostMaxSize', clean_input($_POST['post_max_size']));
            }
            if (isset($_POST['upload_max_filesize'])) {
                $phpini->setDomainIni('phpiniUploadMaxFileSize', clean_input($_POST['upload_max_filesize']));
            }
            if (isset($_POST['max_execution_time'])) {
                $phpini->setDomainIni('phpiniMaxExecutionTime', clean_input($_POST['max_execution_time']));
            }
            if (isset($_POST['max_input_time'])) {
                $phpini->setDomainIni('phpiniMaxInputTime', clean_input($_POST['max_input_time']));
            }
        } else {
            $phpini->loadClientPermissions();
            // Reset client PHP permissions to default values
            $phpini->loadDomainIni();
            // Reset domain PHP configuration options to default values
        }
    } else {
        $phpini->loadClientPermissions();
        // Reset client PHP permissions to default values
        $phpini->loadDomainIni();
        // Reset domain PHP configuration options to default values
    }
    if (!Zend_Session::namespaceIsset('pageMessages')) {
        return true;
    }
    if (!empty($errFieldsStack)) {
        iMSCP_Registry::set('errFieldsStack', $errFieldsStack);
    }
    return false;
}
Exemplo n.º 5
0
/**
 * Generates features form
 *
 * Note: For now most block for the features are always show. That will change when
 * admin will be able to disable them for a specific reseller.
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 * @param array $data Domain data
 * @return void
 */
function _reseller_generateFeaturesForm($tpl, &$data)
{
    $cfg = iMSCP_Registry::get('config');
    $tpl->assign(array('TR_FEATURES' => tr('Features'), 'TR_PHP' => tr('PHP'), 'PHP_YES' => $data['domain_php'] == 'yes' ? ' checked' : '', 'PHP_NO' => $data['domain_php'] != 'yes' ? ' checked' : ''));
    $phpini = iMSCP_PHPini::getInstance();
    // PHP editor - begin
    if (!$phpini->resellerHasPermission('phpiniSystem')) {
        $tpl->assign('PHP_EDITOR_BLOCK', '');
    } else {
        $tpl->assign(array('TR_SETTINGS' => tr('PHP Settings'), 'TR_PHP_EDITOR' => tr('PHP Editor'), 'TR_PHP_EDITOR_SETTINGS' => tr('PHP Settings'), 'TR_PERMISSIONS' => tr('PHP Permissions'), 'TR_DIRECTIVES_VALUES' => tr('PHP directives values'), 'TR_FIELDS_OK' => tr('All fields are valid.'), 'TR_MIB' => tr('MiB'), 'TR_SEC' => tr('Sec.'), 'PHP_EDITOR_YES' => $phpini->clientHasPermission('phpiniSystem') ? ' checked' : '', 'PHP_EDITOR_NO' => $phpini->clientHasPermission('phpiniSystem') ? '' : ' checked'));
        $permissionsBlock = false;
        if (!$phpini->resellerHasPermission('phpiniAllowUrlFopen')) {
            $tpl->assign('PHP_EDITOR_ALLOW_URL_FOPEN_BLOCK', '');
        } else {
            $tpl->assign(array('TR_CAN_EDIT_ALLOW_URL_FOPEN' => tr('Can edit the PHP %s configuration option', '<b>allow_url_fopen</b>'), 'ALLOW_URL_FOPEN_YES' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? ' checked' : '', 'ALLOW_URL_FOPEN_NO' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? '' : ' checked'));
            $permissionsBlock = true;
        }
        if (!$phpini->resellerHasPermission('phpiniDisplayErrors')) {
            $tpl->assign('PHP_EDITOR_DISPLAY_ERRORS_BLOCK', '');
        } else {
            $tpl->assign(array('TR_CAN_EDIT_DISPLAY_ERRORS' => tr('Can edit the PHP %s configuration option', '<b>display_errors</b>'), 'DISPLAY_ERRORS_YES' => $phpini->clientHasPermission('phpiniDisplayErrors') ? ' checked' : '', 'DISPLAY_ERRORS_NO' => $phpini->clientHasPermission('phpiniDisplayErrors') ? '' : ' checked'));
            $permissionsBlock = true;
        }
        if ($cfg['HTTPD_SERVER'] == 'apache_itk') {
            $tpl->assign(array('PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK' => '', 'PHP_EDITOR_MAIL_FUNCTION_BLOCK' => ''));
        } else {
            if ($phpini->resellerHasPermission('phpiniDisableFunctions')) {
                $tpl->assign(array('TR_CAN_EDIT_DISABLE_FUNCTIONS' => tr('Can edit the PHP %s configuration option', '<b>disable_functions</b>'), 'DISABLE_FUNCTIONS_YES' => $phpini->getClientPermission('phpiniDisableFunctions') == 'yes' ? ' checked' : '', 'DISABLE_FUNCTIONS_NO' => $phpini->getClientPermission('phpiniDisableFunctions') == 'no' ? ' checked' : '', 'TR_ONLY_EXEC' => tr('Only exec'), 'DISABLE_FUNCTIONS_EXEC' => $phpini->getClientPermission('phpiniDisableFunctions') == 'exec' ? ' checked' : ''));
            } else {
                $tpl->assign('PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK', '');
            }
            if ($phpini->resellerHasPermission('phpiniMailFunction')) {
                $tpl->assign(array('TR_CAN_USE_MAIL_FUNCTION' => tr('Can use the PHP %s function', '<b>mail</b>'), 'MAIL_FUNCTION_YES' => $phpini->clientHasPermission('phpiniMailFunction') == 'yes' ? ' checked' : '', 'MAIL_FUNCTION_NO' => $phpini->clientHasPermission('phpiniMailFunction') == 'no' ? '' : ' checked'));
            } else {
                $tpl->assign('PHP_EDITOR_MAIL_FUNCTION_BLOCK', '');
            }
            $permissionsBlock = true;
        }
        if (!$permissionsBlock) {
            $tpl->assign('PHP_EDITOR_PERMISSIONS_BLOCK', '');
        }
        $tpl->assign(array('TR_POST_MAX_SIZE' => tr('PHP %s configuration option', '<b>post_max_size</b>'), 'POST_MAX_SIZE' => tohtml($phpini->getDomainIni('phpiniPostMaxSize'), 'htmlAttr'), 'TR_UPLOAD_MAX_FILEZISE' => tr('PHP %s configuration option', '<b>upload_max_filesize</b>'), 'UPLOAD_MAX_FILESIZE' => tohtml($phpini->getDomainIni('phpiniUploadMaxFileSize'), 'htmlAttr'), 'TR_MAX_EXECUTION_TIME' => tr('PHP %s configuration option', '<b>max_execution_time</b>'), 'MAX_EXECUTION_TIME' => tohtml($phpini->getDomainIni('phpiniMaxExecutionTime'), 'htmlAttr'), 'TR_MAX_INPUT_TIME' => tr('PHP %s configuration option', '<b>max_input_time</b>'), 'MAX_INPUT_TIME' => tohtml($phpini->getDomainIni('phpiniMaxInputTime'), 'htmlAttr'), 'TR_MEMORY_LIMIT' => tr('PHP %s configuration option', '<b>memory_limit</b>'), 'MEMORY_LIMIT' => tohtml($phpini->getDomainIni('phpiniMemoryLimit'), 'htmlAttr'), 'POST_MAX_SIZE_LIMIT' => tohtml($phpini->getResellerPermission('phpiniPostMaxSize'), 'htmlAttr'), 'UPLOAD_MAX_FILESIZE_LIMIT' => tohtml($phpini->getResellerPermission('phpiniUploadMaxFileSize'), 'htmlAttr'), 'MAX_EXECUTION_TIME_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMaxExecutionTime'), 'htmlAttr'), 'MAX_INPUT_TIME_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMaxInputTime'), 'htmlAttr'), 'MEMORY_LIMIT_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMemoryLimit'), 'htmlAttr')));
    }
    iMSCP_Events_Aggregator::getInstance()->registerListener('onGetJsTranslations', function ($e) {
        /** @var iMSCP_Events_Event $e */
        $translations = $e->getParam('translations');
        $translations['core']['close'] = tr('Close');
        $translations['core']['fields_ok'] = tr('All fields are valid.');
        $translations['core']['out_of_range_value_error'] = tr('Value for the PHP %%s directive must be in range %%d to %%d.');
        $translations['core']['lower_value_expected_error'] = tr('%%s must be lower than %%s.');
        $translations['core']['error_field_stack'] = iMSCP_Registry::isRegistered('errFieldsStack') ? iMSCP_Registry::get('errFieldsStack') : array();
    });
    // PHP editor - end
    // CGI support
    $tpl->assign(array('TR_CGI' => tr('CGI'), 'CGI_YES' => $data['domain_cgi'] == 'yes' ? ' checked' : '', 'CGI_NO' => $data['domain_cgi'] != 'yes' ? ' checked' : ''));
    // Custom DNS records
    if (resellerHasFeature('custom_dns_records')) {
        $tpl->assign(array('TR_DNS' => tr('Custom DNS records'), 'DNS_YES' => $data['domain_dns'] == 'yes' ? ' checked' : '', 'DNS_NO' => $data['domain_dns'] != 'yes' ? ' checked' : ''));
    } else {
        $tpl->assign('CUSTOM_DNS_RECORDS_FEATURE', '');
    }
    // APS support
    if ($data['software_allowed'] == 'no') {
        $tpl->assign('APS_BLOCK', '');
    } else {
        $tpl->assign(array('TR_APS' => tr('Software installer'), 'APS_YES' => $data['domain_software_allowed'] == 'yes' ? ' checked' : '', 'APS_NO' => $data['domain_software_allowed'] != 'yes' ? ' checked' : ''));
    }
    // External mail support
    if ($data['max_mail_cnt'] == '-1') {
        $tpl->assign('EXT_MAIL_BLOCK', '');
    } else {
        $tpl->assign(array('TR_EXTMAIL' => tr('External mail server'), 'EXTMAIL_YES' => $data['domain_external_mail'] == 'yes' ? ' checked' : '', 'EXTMAIL_NO' => $data['domain_external_mail'] != 'yes' ? ' checked' : ''));
    }
    if ($cfg['BACKUP_DOMAINS'] == 'yes') {
        // Backup support
        $tpl->assign(array('TR_BACKUP' => tr('Backup'), 'TR_BACKUP_DOMAIN' => tr('Domain'), 'BACKUP_DOMAIN' => in_array('dmn', $data['allowbackup']) ? ' checked' : '', 'TR_BACKUP_SQL' => tr('SQL'), 'BACKUP_SQL' => in_array('sql', $data['allowbackup']) ? ' checked' : '', 'TR_BACKUP_MAIL' => tr('Mail'), 'BACKUP_MAIL' => in_array('mail', $data['allowbackup']) ? ' checked' : ''));
    } else {
        $tpl->assign('BACKUP_BLOCK', '');
    }
    $tpl->assign(array('TR_WEB_FOLDER_PROTECTION' => tr('Web folder protection'), 'TR_WEB_FOLDER_PROTECTION_HELP' => tr('If set to `yes`, Web folders will be protected against deletion.'), 'WEB_FOLDER_PROTECTION_YES' => $data['web_folder_protection'] == 'yes' ? ' checked' : '', 'WEB_FOLDER_PROTECTION_NO' => $data['web_folder_protection'] != 'yes' ? ' checked' : '', 'TR_YES' => tr('Yes'), 'TR_NO' => tr('No')));
}
Exemplo n.º 6
0
 * 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 the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
check_login('reseller');
resellerHasFeature('aps') or showBadRequestErrorPage();
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
if (isset($_GET['id']) and is_numeric($_GET['id'])) {
    $query = "\n\t\tSELECT\n\t\t\t`software_id`,\n\t\t\t`software_archive`,\n\t\t\t`software_depot`\n\t\tFROM\n\t\t\t`web_software`\n\t\tWHERE\n\t\t\t`software_id` = ?\n\t\tAND\n\t\t\t`reseller_id` = ?\n\t";
    $rs = exec_query($query, array($_GET['id'], $_SESSION['user_id']));
    if ($rs->recordCount() != 1) {
        set_page_message(tr('Wrong software id.'), 'error');
        redirectTo('software_upload.php');
    } else {
        if ($rs->fields['software_depot'] == "no") {
            $del_path = $cfg->GUI_APS_DIR . "/" . $_SESSION['user_id'] . "/" . $rs->fields['software_archive'] . "-" . $rs->fields['software_id'] . ".tar.gz";
            @unlink($del_path);
        }
        $update = "\n\t\t\tUPDATE\n\t\t\t\t`web_software_inst`\n\t\t\tSET\n\t\t\t\t`software_res_del` = 1\n\t\t\tWHERE\n\t\t\t\t`software_id` = ?\n\t\t";
        $res = exec_query($update, $rs->fields['software_id']);
Exemplo n.º 7
0
 *
 * 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.
 */
/***********************************************************************************************************************
 * Main
 */
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
check_login('reseller');
if (!resellerHasFeature('domain_aliases') || !isset($_GET['id'])) {
    showBadRequestErrorPage();
}
$îd = intval($_GET['id']);
$stmt = exec_query('
        SELECT alias_name
        FROM domain_aliasses INNER JOIN domain USING (domain_id) INNER JOIN admin ON(admin_id = domain_admin_id)
        WHERE alias_id = ? AND created_by = ?
    ', array($îd, $_SESSION['user_id']));
if ($stmt->rowCount()) {
    $row = $stmt->fetchRow();
    deleteDomainAlias($îd, $row['alias_name']);
    redirectTo('alias.php');
}
showBadRequestErrorPage();