示例#1
0
/**
 * Send circular to customers
 *
 * @param string $senderName Sender name
 * @param string $senderEmail Sender email
 * @param string $subject Subject
 * @param string $body Body
 */
function reseller_sendToCustomers($senderName, $senderEmail, $subject, $body)
{
    if (resellerHasCustomers()) {
        $stmt = exec_query('SELECT `admin_name`, `fname`, `lname`, `email` FROM `admin` WHERE `created_by` = ?', $_SESSION['user_id']);
        while ($rcptToData = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
            reseller_sendEmail($senderName, $senderEmail, $subject, $body, $rcptToData);
        }
    }
}
示例#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')));
示例#3
0
        if ($nextSi + 1 > $rowCount) {
            $tpl->assign('SCROLL_NEXT', '');
        } else {
            $tpl->assign(array('SCROLL_NEXT_GRAY' => '', 'NEXT_PSI' => $nextSi));
        }
    } else {
        $tpl->assign('CUSTOMER_LIST', '');
        set_page_message(tr('No customer with OpenDKIM support has been found.'), 'static_info');
    }
}
/***********************************************************************************************************************
 * Main
 */
EventManager::getInstance()->dispatch(Events::onResellerScriptStart);
check_login('reseller');
if (resellerHasCustomers()) {
    if (isset($_REQUEST['action'])) {
        $action = clean_input($_REQUEST['action']);
        if (isset($_REQUEST['admin_id']) && $_REQUEST['admin_id'] != '') {
            $customerId = intval($_REQUEST['admin_id']);
            switch ($action) {
                case 'activate':
                    opendkim_activate($customerId);
                    break;
                case 'deactivate':
                    opendkim_deactivate($customerId);
                    break;
                default:
                    showBadRequestErrorPage();
            }
            redirectTo('opendkim.php');