当前位置: 首页>>代码示例>>PHP>>正文


PHP iMSCP_pTemplate::define_dynamic方法代码示例

本文整理汇总了PHP中iMSCP_pTemplate::define_dynamic方法的典型用法代码示例。如果您正苦于以下问题:PHP iMSCP_pTemplate::define_dynamic方法的具体用法?PHP iMSCP_pTemplate::define_dynamic怎么用?PHP iMSCP_pTemplate::define_dynamic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iMSCP_pTemplate的用法示例。


在下文中一共展示了iMSCP_pTemplate::define_dynamic方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doAction

                    $pluginManager->pluginSetStatus($pluginName, 'todisable');
                    $action = 'disable';
            }
            doAction($pluginManager, $pluginName, $action);
        } else {
            showBadRequestErrorPage();
        }
    } elseif (isset($_POST['bulk_actions'])) {
        doBulkAction($pluginManager);
    } elseif (!empty($_FILES) && uploadPlugin($pluginManager)) {
        OpcodeCacheUtils::clearAllActive();
        // Force newest files to be loaded on next run
        set_page_message(tr('Plugin has been successfully uploaded.'), 'success');
        redirectTo('settings_plugins.php?update_plugin_list');
    }
    redirectTo('settings_plugins.php');
}
$tpl = new TemplateEngine();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/settings_plugins.tpl', 'page_message' => 'layout', 'plugins_block' => 'page', 'plugin_block' => 'plugins_block', 'plugin_status_details_block' => 'plugin_block', 'plugin_activate_link' => 'plugin_block', 'plugin_deactivate_link' => 'plugin_block', 'plugin_protected_link' => 'plugin_block'));
EventManager::getInstance()->registerListener(Events::onGetJsTranslations, function ($event) {
    /** @var $event \iMSCP_Events_Event $translations */
    $event->getParam('translations')->core = array_merge($event->getParam('translations')->core, array('dataTable' => getDataTablesPluginTranslations(false), 'force_retry' => tr('Force retry'), 'close' => tr('Close'), 'error_details' => tr('Error details')));
});
$tpl->assign(array('TR_PAGE_TITLE' => tr('Admin / Settings / Plugin Management'), 'TR_BULK_ACTIONS' => tr('Bulk Actions'), 'TR_PLUGIN' => tr('Plugin'), 'TR_DESCRIPTION' => tr('Description'), 'TR_STATUS' => tr('Status'), 'TR_ACTIONS' => tr('Actions'), 'TR_INSTALL' => tr('Install'), 'TR_ACTIVATE' => tr('Activate'), 'TR_DEACTIVATE_TOOLTIP' => tr('Deactivate this plugin'), 'TR_DEACTIVATE' => tr('Deactivate'), 'TR_UNINSTALL' => tr('Uninstall'), 'TR_PROTECT' => tr('Protect'), 'TR_DELETE' => tr('Delete'), 'TR_PROTECT_TOOLTIP' => tr('Protect this plugin'), 'TR_VERSION' => tr('Version'), 'TR_BY' => tr('By'), 'TR_VISIT_PLUGIN_SITE' => tr('Visit plugin site'), 'TR_UPDATE_PLUGIN_LIST' => tr('Update Plugins'), 'TR_APPLY' => tr('Apply'), 'TR_PLUGIN_UPLOAD' => tr('Plugins Upload'), 'TR_UPLOAD' => tr('Upload'), 'TR_PLUGIN_ARCHIVE' => tr('Plugin archive'), 'TR_PLUGIN_ARCHIVE_TOOLTIP' => tr('Only tar.gz, tar.bz2 and zip archives are accepted.'), 'TR_PLUGIN_HINT' => tr('Plugins hook into i-MSCP to extend its functionality with custom features. Plugins are developed independently from the core i-MSCP application by thousands of developers all over the world. You can find new plugins to install by browsing the %s.', '<a style="text-decoration: underline" href="http://i-mscp.net/filebase/index.php/Filebase/" target="_blank">' . tr('i-MSCP plugin store') . '</a></u>'), 'TR_CLICK_FOR_MORE_DETAILS' => tr('Click here for more details')));
generateNavigation($tpl);
generatePage($tpl, $pluginManager);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
EventManager::getInstance()->dispatch(Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:settings_plugins.php

示例2: tr

            break;
        case "reseller":
            $trUserType = tr('Reseller');
            break;
        case "admin":
            $trUserType = tr('Admin');
            break;
        default:
            $trUserType = tr('Unknown user type');
    }
    $tpl->assign(array('TR_ACCOUNT_SUMMARY' => tr('Account summary'), 'TR_USERNAME' => tr('Username'), 'USERNAME' => tohtml($_SESSION['user_logged']), 'TR_ACCOUNT_TYPE' => tr('Account type'), 'ACCOUNT_TYPE' => $trUserType, 'TR_REGISTRATION_DATE' => tr('Registration date'), 'REGISTRATION_DATE' => $stmt->fields['domain_created'] != 0 ? date($cfg->DATE_FORMAT, $stmt->fields['domain_created']) : tr('Unknown')));
}
/*******************************************************************************
 * Main script
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptStart);
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
check_login('user');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'client/profile.tpl', 'page_message' => 'layout'));
$tpl->assign('TR_PAGE_TITLE', tr('Client / Profile / Account Summary'));
generateNavigation($tpl);
client_generatePage($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:profile.php

示例3: intval

check_login('admin');
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
if (isset($_GET['edit_id'])) {
    $userId = intval($_GET['edit_id']);
} else {
    showBadRequestErrorPage();
    exit;
}
if (!empty($_POST) && admin_isValidData()) {
    admin_updateUserData($userId);
    set_page_message(tr('User data successfully updated.'), 'success');
    redirectTo('manage_users.php');
}
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/admin_edit.tpl', 'page_message' => 'layout', 'hosting_plans' => 'page'));
// For admin, we redirect to it own personal change page.
if ($userId == $_SESSION['user_id']) {
    redirectTo('personal_change.php');
}
$query = "\n\tSELECT\n\t\t`admin_name`, `admin_type`, `fname`, `lname`, `firm`, `zip`, `city`, `state`, `country`, `phone`, `fax`,\n\t\t`street1`, `street2`, `email`, `gender`\n\tFROM\n\t\t`admin`\n\tWHERE\n\t\t`admin_id` = ?\n";
$stmt = exec_query($query, $userId);
if (!$stmt->rowCount()) {
    redirectTo('manage_users.php');
}
generateNavigation($tpl);
$tpl->assign(array('TR_PAGE_TITLE' => tr('Admin / Users / Overview / Edit Admin'), 'TR_EMPTY_OR_WORNG_DATA' => tr('Empty data or wrong field.'), 'TR_PASSWORD_NOT_MATCH' => tr("Passwords do not match."), 'TR_CORE_DATA' => tr('Core data'), 'TR_USERNAME' => tr('Username'), 'TR_PASSWORD' => tr('Password'), 'TR_PASSWORD_REPEAT' => tr('Password confirmation'), 'TR_EMAIL' => tr('Email'), 'TR_ADDITIONAL_DATA' => tr('Additional data'), 'TR_FIRST_NAME' => tr('First name'), 'TR_LAST_NAME' => tr('Last name'), 'TR_COMPANY' => tr('Company'), 'TR_ZIP_POSTAL_CODE' => tr('Zip/Postal code'), 'TR_CITY' => tr('City'), 'TR_STATE_PROVINCE' => tr('State/Province'), 'TR_COUNTRY' => tr('Country'), 'TR_STREET_1' => tr('Street 1'), 'TR_STREET_2' => tr('Street 2'), 'TR_PHONE' => tr('Phone'), 'TR_FAX' => tr('Fax'), 'TR_GENDER' => tr('Gender'), 'TR_MALE' => tr('Male'), 'TR_FEMALE' => tr('Female'), 'TR_UNKNOWN' => tr('Unknown'), 'TR_UPDATE' => tr('Update'), 'TR_SEND_DATA' => tr('Send new login data'), 'FIRST_NAME' => isset($_POST['fname']) ? tohtml($_POST['fname']) : tohtml($stmt->fields['fname']), 'LAST_NAME' => isset($_POST['lname']) ? tohtml($_POST['lname']) : tohtml($stmt->fields['lname']), 'FIRM' => isset($_POST['firm']) ? tohtml($_POST['firm']) : tohtml($stmt->fields['firm']), 'ZIP' => isset($_POST['zip']) ? tohtml($_POST['zip']) : tohtml($stmt->fields['zip']), 'CITY' => isset($_POST['city']) ? tohtml($_POST['city']) : tohtml($stmt->fields['city']), 'STATE_PROVINCE' => isset($_POST['state']) ? tohtml($_POST['state']) : tohtml($stmt->fields['state']), 'COUNTRY' => isset($_POST['country']) ? tohtml($_POST['country']) : tohtml($stmt->fields['country']), 'STREET_1' => isset($_POST['street1']) ? tohtml($_POST['street1']) : tohtml($stmt->fields['street1']), 'STREET_2' => isset($_POST['street2']) ? tohtml($_POST['street2']) : tohtml($stmt->fields['street2']), 'PHONE' => isset($_POST['phone']) ? tohtml($_POST['phone']) : tohtml($stmt->fields['phone']), 'FAX' => isset($_POST['fax']) ? tohtml($_POST['fax']) : tohtml($stmt->fields['fax']), 'USERNAME' => tohtml(decode_idna($stmt->fields['admin_name'])), 'EMAIL' => isset($_POST['email']) ? tohtml($_POST['email']) : tohtml($stmt->fields['email']), 'VL_MALE' => isset($_POST['gender']) && $_POST['gender'] == 'M' || $stmt->fields['gender'] == 'M' ? $cfg->HTML_SELECTED : '', 'VL_FEMALE' => isset($_POST['gender']) && $_POST['gender'] == 'F' || $stmt->fields['gender'] == 'F' ? $cfg->HTML_SELECTED : '', 'VL_UNKNOWN' => isset($_POST['gender']) && $_POST['gender'] == 'U' || !isset($_POST['gender']) && ($stmt->fields['gender'] == 'U' || empty($stmt->fields['gender'])) ? $cfg->HTML_SELECTED : '', 'SEND_DATA_CHECKED' => isset($_POST['send_data']) ? $cfg->HTML_CHECKED : '', 'EDIT_ID' => $userId));
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:admin_edit.php

示例4: isset

}
/***********************************************************************************************************************
 * Main
 */
iMSCP_Events_Manager::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
check_login('reseller');
if (iMSCP_Registry::isRegistered('pluginManager')) {
    /** @var iMSCP_Plugin_Manager $pluginManager */
    $pluginManager = iMSCP_Registry::get('pluginManager');
} else {
    throw new iMSCP_Plugin_Exception('An unexpected error occured');
}
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => '../../plugins/OwnDDNS/frontend/reseller/ownddns.tpl', 'page_message' => 'layout', 'ownddns_list' => 'page', 'ownddns_edit' => 'page', 'ownddns_select_item' => 'page', 'ownddns_customer_list' => 'page', 'ownddns_customer_item' => 'page', 'ownddns_no_customer_item' => 'page', 'scroll_prev_gray' => 'ownddns_customer_list', 'scroll_prev' => 'ownddns_customer_list', 'scroll_next_gray', 'ownddns_customer_list', 'scroll_next' => 'ownddns_customer_list'));
if (isset($_REQUEST['action'])) {
    $action = clean_input($_REQUEST['action']);
    if ($action === 'activate') {
        $customerAdminId = isset($_POST['admin_id']) && $_POST['admin_id'] !== '-1' ? clean_input($_POST['admin_id']) : '';
        if ($customerAdminId != '') {
            ownddns_activateCustomer($tpl, $pluginManager, $customerAdminId, $_SESSION['user_id']);
        }
    } elseif ($action === 'edit') {
        $customerAdminId = $_GET['admin_id'] !== '' ? (int) clean_input($_GET['admin_id']) : '';
        if ($customerAdminId != '') {
            ownddns_changeCustomerOwnDDNS($tpl, $customerAdminId, $_SESSION['user_id']);
        }
    } elseif ($action === 'delete') {
        $customerAdminId = isset($_GET['admin_id']) ? clean_input($_GET['admin_id']) : '';
        if ($customerAdminId != '') {
开发者ID:svenjantzen,项目名称:plugins,代码行数:31,代码来源:ownddns.php

示例5: isset

}
/***********************************************************************************************************************
 * Main
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptStart);
check_login('admin');
// Register iMSCP_NetworkCard instance in registry for shared access
iMSCP_Registry::set('networkCardObject', new iMSCP_NetworkCard());
if (!empty($_POST)) {
    $ipNumber = isset($_POST['ip_number']) ? trim($_POST['ip_number']) : '';
    $netCard = isset($_POST['ip_card']) ? clean_input($_POST['ip_card']) : '';
    if (client_checkIpData($ipNumber, $netCard)) {
        client_registerIp($ipNumber, $netCard);
    }
}
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/ip_manage.tpl', 'page_message' => 'layout', 'ip_addresses_block' => 'page', 'ip_address_block' => 'ip_addresses_block', 'ip_address_form_block' => 'page', 'network_card_block' => 'ip_address_form_block'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Admin / Settings / IP Addresses Management'), 'TR_IP' => tr('IP Address'), 'TR_ACTION' => tr('Action'), 'TR_NETWORK_CARD' => tr('Network interface'), 'TR_ADD' => tr('Add'), 'TR_CANCEL' => tr('Cancel'), 'TR_CONFIGURED_IPS' => tr('IP addresses under control of i-MSCP'), 'TR_ADD_NEW_IP' => tr('Add new IP address'), 'TR_IP_DATA' => tr('IP address data'), 'TR_MESSAGE_DELETE' => json_encode(tr('Are you sure you want to delete this IP: %s?', '%s')), 'TR_MESSAGE_DENY_DELETE' => json_encode(tr('You cannot remove the %s IP address.', '%s')), 'ERR_FIELDS_STACK' => iMSCP_Registry::isRegistered('errFieldsStack') ? json_encode(iMSCP_Registry::get('errFieldsStack')) : '[]', 'TR_TIP' => tr('This interface allow to add or remove IP addresses. IP addresses listed below are already under the control of i-MSCP. IP addresses which are added through this interface will be automatically added into the i-MSCP database, and will be available for assignment to one or many of your resellers. If an IP address is not already configured on the system, it will be attached to the selected network interface.')));
iMSCP_Events_Aggregator::getInstance()->registerListener('onGetJsTranslations', function ($e) {
    /** @var $e \iMSCP_Events_Event */
    $e->getParam('translations')->core['dataTable'] = getDataTablesPluginTranslations(false);
});
generateNavigation($tpl);
client_generatePage($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:ip_manage.php

示例6: elseif

/***********************************************************************************************************************
 * Main
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptStart);
// Check for login
check_login('admin');
// Adds a service port or updates one or more services ports
if (isset($_POST['uaction']) && $_POST['uaction'] != 'reset') {
    admin_addUpdateServices(clean_input($_POST['uaction']));
    // Deletes a service port
} elseif (isset($_GET['delete'])) {
    deleteService(clean_input($_GET['delete']));
}
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/settings_ports.tpl', 'page_message' => 'layout', 'service_ports' => 'page', 'port_delete_link' => 'service_ports'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Admin / Settings / Service Ports'), 'TR_ACTION' => tr('Action'), 'TR_UDP' => tr('udp'), 'TR_TCP' => tr('tcp'), 'TR_ENABLED' => tr('Yes'), 'TR_DISABLED' => tr('No'), 'TR_SERVERPORTS' => tr('Server ports'), 'TR_SERVICE' => tr('Service Name'), 'TR_IP' => tr('IP address'), 'TR_PORT' => tr('Port'), 'TR_PROTOCOL' => tr('Protocol'), 'TR_SHOW' => tr('Show'), 'TR_DELETE' => tr('Delete'), 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete %s service port ?', '%s'), 'TR_ADD_NEW_SERVICE_PORT' => tr('Add new service port'), 'VAL_FOR_SUBMIT_ON_UPDATE' => tr('Update'), 'VAL_FOR_SUBMIT_ON_ADD' => tr('Add'), 'VAL_FOR_SUBMIT_ON_RESET' => tr('Reset')));
iMSCP_Events_Aggregator::getInstance()->registerListener('onGetJsTranslations', function ($e) {
    /** @var $e \iMSCP_Events_Event */
    $e->getParam('translations')->core['dataTable'] = getDataTablesPluginTranslations(false);
});
generateNavigation($tpl);
admin_showServices($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:settings_ports.php

示例7: elseif

                return;
            } else {
                set_page_message($updateVersion->getError(), 'error');
            }
        } elseif ($updateVersion->getError()) {
            set_page_message($updateVersion, 'error');
        } else {
            set_page_message(tr('No update available'), 'static_info');
        }
    }
    $tpl->assign('UPDATE_INFO', '');
}
/***********************************************************************************************************************
 * Main
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptStart);
check_login('admin');
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/imscp_updates.tpl', 'page_message' => 'layout', 'update_info' => 'page'));
$tpl->assign('TR_PAGE_TITLE', tr('Admin / System Tools / i-MSCP Updates'));
generateNavigation($tpl);
admin_generatePage($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:imscp_updates.php

示例8: resellerHasCustomers

    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')));
generateNavigation($tpl);
generatePage($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:alias_add.php

示例9: intval

 */
require 'imscp-lib.php';
$eventManager = iMSCP_Events_Aggregator::getInstance();
$eventManager->dispatch(iMSCP_Events::onAdminScriptStart);
check_login('admin');
if (isset($_GET['reseller_id'])) {
    $resellerId = intval($_GET['reseller_id']);
    $_SESSION['stats_reseller_id'] = $resellerId;
} elseif (isset($_SESSION['stats_reseller_id'])) {
    redirectTo('reseller_user_statistics.php?reseller_id=' . $_SESSION['stats_reseller_id']);
    exit;
} else {
    showBadRequestErrorPage();
    exit;
}
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/reseller_user_statistics.tpl', 'page_message' => 'layout', 'reseller_user_statistics_block' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tohtml(tr('Admin / Statistics / Reseller Statistics / User Statistics')), 'TR_USERNAME' => tohtml(tr('User')), 'TR_TRAFF' => tohtml(tr('Traffic usage')), 'TR_DISK' => tohtml(tr('Disk usage')), 'TR_WEB' => tohtml(tr('HTTP traffic')), 'TR_FTP_TRAFF' => tohtml(tr('FTP traffic')), 'TR_SMTP' => tohtml(tr('SMTP traffic')), 'TR_POP3' => tohtml(tr('POP3/IMAP traffic')), 'TR_SUBDOMAIN' => tohtml(tr('Subdomains')), 'TR_ALIAS' => tohtml(tr('Aliases')), 'TR_MAIL' => tohtml(tr('Email accounts')), 'TR_FTP' => tohtml(tr('FTP accounts')), 'TR_SQL_DB' => tohtml(tr('SQL databases')), 'TR_SQL_USER' => tohtml(tr('SQL users')), 'TR_DETAILED_STATS_TOOLTIP' => tohtml(tr('Show detailed statistics for this user'), 'htmlAttr')));
$eventManager->registerListener('onGetJsTranslations', function ($e) {
    /** @var $e \iMSCP_Events_Event */
    $e->getParam('translations')->core['dataTable'] = getDataTablesPluginTranslations(false);
});
generateNavigation($tpl);
generatePage($tpl, $resellerId);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
$eventManager->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:reseller_user_statistics.php

示例10: tohtml

            } else {
                $senderEmail = 'webmaster@' . $config['BASE_SERVER_VHOST'];
            }
        }
    }
    $tpl->assign(array('SENDER_NAME' => tohtml($senderName), 'SENDER_EMAIL' => tohtml($senderEmail), 'SUBJECT' => tohtml($subject), 'BODY' => tohtml($body)));
}
/***********************************************************************************************************************
 * Main
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
check_login('reseller');
if (!resellerHasCustomers()) {
    showBadRequestErrorPage();
}
if (!(!empty($_POST) && reseller_sendCircular())) {
    $tpl = new iMSCP_pTemplate();
    $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'reseller/circular.tpl', 'page_message' => 'layout'));
    $tpl->assign(array('TR_PAGE_TITLE' => tr('Reseller / Customers / Circular'), 'TR_CIRCULAR' => tr('Circular'), 'TR_SEND_TO' => tr('Send to'), 'TR_SUBJECT' => tr('Subject'), 'TR_BODY' => tr('Body'), 'TR_SENDER_EMAIL' => tr('Sender email'), 'TR_SENDER_NAME' => tr('Sender name'), 'TR_SEND_CIRCULAR' => tr('Send circular'), 'TR_CANCEL' => tr('Cancel')));
    generateNavigation($tpl);
    generatePageMessage($tpl);
    reseller_generatePageData($tpl);
    $tpl->parse('LAYOUT_CONTENT', 'page');
    iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl));
    $tpl->prnt();
    unsetMessages();
} else {
    redirectTo('users.php');
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:circular.php

示例11: redirectTo

// Purge expired sessions
do_session_timeout();
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
// Lost password feature is disabled ?
if (!$cfg['LOSTPASSWORD']) {
    redirectTo('/index.php');
}
// Check for gd library availability
if (!check_gd()) {
    throw new iMSCP_Exception(tr("PHP GD extension not loaded."));
}
// Remove old unique keys
removeOldKeys($cfg['LOSTPASSWORD_TIMEOUT']);
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/simple.tpl', 'page' => 'lostpassword.tpl', 'page_message' => 'layout'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('i-MSCP - Multi Server Control Panel / Lost Password'), 'CONTEXT_CLASS' => '', 'productLongName' => tr('internet Multi Server Control Panel'), 'productLink' => 'http://www.i-mscp.net', 'productCopyright' => tr('© 2010-2015 i-MSCP Team<br/>All Rights Reserved'), 'TR_CAPCODE' => tr('Security code'), 'GET_NEW_IMAGE' => tr('Get a new image'), 'TR_IMGCAPCODE' => '<img id="captcha" src="imagecode.php" width="' . $cfg['LOSTPASSWORD_CAPTCHA_WIDTH'] . '" height="' . $cfg['LOSTPASSWORD_CAPTCHA_HEIGHT'] . '" alt="captcha image" />', 'TR_USERNAME' => tr('Username'), 'TR_SEND' => tr('Send'), 'TR_CANCEL' => tr('Cancel')));
// A request for new password was validated ( User clicked on the link he has received by mail )
if (isset($_GET['key']) && $_GET['key'] != '') {
    // Check key
    clean_input($_GET['key']);
    // Sending new password
    if (sendPassword($_GET['key'])) {
        set_page_message(tr('Your new password has been sent. Check your email.'), 'success');
        redirectTo('index.php');
    } else {
        set_page_message(tr('New password has not been sent. Ask your administrator.'), 'error');
    }
} elseif (!empty($_POST)) {
    // Request for new password
    $bruteForce = new iMSCP_Plugin_Bruteforce(iMSCP_Registry::get('pluginManager'), 'captcha');
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:lostpassword.php

示例12: admin_generateCustomerAcountDeletionValidationPage

/**
 * Generates customer account deletion validation page.
 *
 * @param int $userId Customer account unique identifier
 * @return iMSCP_pTemplate
 */
function admin_generateCustomerAcountDeletionValidationPage($userId)
{
    /** @var $cfg iMSCP_Config_Handler_File */
    $cfg = iMSCP_Registry::get('config');
    $stmt = exec_query('SELECT admin_name FROM admin WHERE admin_id = ?', $userId);
    if (!$stmt->rowCount()) {
        showBadRequestErrorPage();
    }
    $adminName = decode_idna($stmt->fields['admin_name']);
    $tpl = new iMSCP_pTemplate();
    $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/user_delete.tpl', 'page_message' => 'layout', 'mail_list' => 'page', 'mail_item' => 'mail_list', 'ftp_list' => 'page', 'ftp_item' => 'ftp_list', 'dmn_list' => 'page', 'dmn_item' => 'dmn_list', 'als_list' => 'page', 'als_item' => 'als_list', 'sub_list' => 'page', 'sub_item' => 'sub_list', 'db_list' => 'page', 'db_item' => 'db_list'));
    $tpl->assign(array('TR_PAGE_TITLE' => tr('Admin / Users / Overview / Delete Customer'), 'TR_ACCOUNT_SUMMARY' => tr('Customer account summary'), 'TR_EMAILS' => tr('Emails'), 'TR_FTP_ACCOUNTS' => tr('Ftp accounts'), 'TR_DOMAINS' => tr('Domains'), 'TR_DOMAIN_ALIASES' => tr('Domain aliases'), 'TR_SUBDOMAINS' => tr('Subdomains'), 'TR_DATABASES' => tr('SQL databases'), 'TR_REALLY_WANT_TO_DELETE_CUSTOMER_ACCOUNT' => tr("Do you really want to delete the entire %s customer account? This operation cannot be undone.", "<strong>{$adminName}</strong>"), 'USER_ID' => $userId, 'TR_YES_DELETE_ACCOUNT' => tr('Yes, delete this account.'), 'TR_DELETE' => tr('Delete'), 'TR_CANCEL' => tr('Cancel')));
    generateNavigation($tpl);
    // Checks for mail accounts
    $stmt = exec_query('
			SELECT
				mail_type, mail_addr
			FROM
				mail_users
			WHERE
				domain_id IN (SELECT domain_id FROM domain WHERE domain_admin_id = ?)
		', $userId);
    if ($stmt->rowCount()) {
        while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
            $mailTypes = explode(',', $row['mail_type']);
            $mailTypesdisplayArray = array();
            foreach ($mailTypes as $mtype) {
                $mailTypesdisplayArray[] = user_trans_mail_type($mtype);
            }
            $mailTypesdisplayTxt = implode(', ', $mailTypesdisplayArray);
            $addr = explode('@', $row['mail_addr']);
            $tpl->assign(array('MAIL_ADDR' => tohtml($addr[0] . '@' . decode_idna($addr[1])), 'MAIL_TYPE' => $mailTypesdisplayTxt));
            $tpl->parse('MAIL_ITEM', '.mail_item');
        }
    } else {
        $tpl->assign('MAIL_LIST', '');
    }
    // Checks for FTP accounts
    $stmt = exec_query('SELECT userid, homedir FROM ftp_users WHERE admin_id = ?', $userId);
    if ($stmt->rowCount()) {
        while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
            $username = explode('@', $row['userid']);
            $tpl->assign(array('FTP_USER' => tohtml($username[0] . '@' . decode_idna($username[1])), 'FTP_HOME' => tohtml(substr($row['homedir'], strlen($cfg->USER_WEB_DIR)))));
            $tpl->parse('FTP_ITEM', '.ftp_item');
        }
    } else {
        $tpl->assign('FTP_LIST', '');
    }
    // Check for domains
    // NOTE: Currently, each customer has only one domain but that will change in near future
    $stmt = exec_query('SELECT domain_id, domain_name FROM domain WHERE domain_admin_id = ?', $userId);
    $domainId = $stmt->fields['domain_id'];
    $domainName = tohtml(decode_idna($stmt->fields['domain_name']));
    $tpl->assign('DOMAIN_NAME', $domainName);
    $tpl->parse('DMN_ITEM', '.dmn_item');
    // Checks for domain's aliases
    $aliasIds = array();
    $stmt = exec_query('SELECT alias_id, alias_name, alias_mount FROM domain_aliasses WHERE domain_id = ?', $domainId);
    if ($stmt->rowCount()) {
        while ($data = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
            $aliasIds[] = $data['alias_id'];
            $tpl->assign(array('ALS_NAME' => tohtml(decode_idna($data['alias_name'])), 'ALS_MNT' => tohtml($data['alias_mount'])));
            $tpl->parse('ALS_ITEM', '.als_item');
        }
    } else {
        $tpl->assign('ALS_LIST', '');
    }
    // Checks for subdomains
    $stmt = exec_query('SELECT subdomain_name, subdomain_mount FROM subdomain WHERE domain_id = ?', $domainId);
    if ($stmt->rowCount()) {
        while ($data = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
            $tpl->assign(array('SUB_NAME' => tohtml(decode_idna($data['subdomain_name'])), 'SUB_MNT' => tohtml($data['subdomain_mount'])));
            $tpl->parse('SUB_ITEM', '.sub_item');
        }
    } else {
        $tpl->assign('SUB_LIST', '');
    }
    // Checks subdomain_alias
    if (count($aliasIds)) {
        $aliasIds = implode(',', $aliasIds);
        $stmt = execute_query("SELECT subdomain_alias_name, subdomain_alias_mount FROM subdomain_alias WHERE alias_id IN ({$aliasIds})");
        if ($stmt->rowCount()) {
            while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
                $tpl->assign(array('SUB_NAME' => tohtml(decode_idna($row['subdomain_alias_name'])), 'SUB_MNT' => tohtml($row['subdomain_alias_mount'])));
                $tpl->parse('SUB_ITEM', '.sub_item');
            }
        }
    }
    // Checks for databases and SQL users
    $stmt = exec_query('SELECT sqld_id, sqld_name FROM sql_database WHERE domain_id = ?', $domainId);
    if ($stmt->rowCount()) {
        while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
            $stmt2 = exec_query('SELECT sqlu_name FROM sql_user WHERE sqld_id = ?', $row['sqld_id']);
            $sqlUsersList = array();
//.........这里部分代码省略.........
开发者ID:svenjantzen,项目名称:imscp,代码行数:101,代码来源:user_delete.php

示例13: showBadRequestErrorPage

 * by moleSoftware GmbH. All Rights Reserved.
 *
 * 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.
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptStart);
check_login('admin');
systemHasAntiRootkits() or showBadRequestErrorPage();
$config = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/rootkit_log.tpl', 'page_message' => 'layout', 'antirootkits_log' => 'page'));
$tpl->assign('TR_PAGE_TITLE', tr('Admin / System Tools / Anti-Rootkits Logs'));
$antiRootkits = array();
if (isset($config['ANTI_ROOTKITS_PACKAGES'])) {
    $antiRootkits = explode(',', $config['ANTI_ROOTKITS_PACKAGES']);
}
$antiRootkits[] = 'Other';
$antiRootkitLogFiles = array('Chkrootkit' => 'CHKROOTKIT_LOG', 'Rkhunter' => 'RKHUNTER_LOG', 'Other' => 'OTHER_ROOTKIT_LOG');
foreach ($antiRootkitLogFiles as $antiRootkit => $logVar) {
    if (!in_array($antiRootkit, $antiRootkits) || !isset($config[$logVar]) || $config[$logVar] == '') {
        unset($antiRootkitLogFiles[$antiRootkit]);
    }
}
if (!empty($antiRootkitLogFiles)) {
    foreach ($antiRootkitLogFiles as $antiRootkit => $logVar) {
        $logFile = $config[$logVar];
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:rootkit_log.php

示例14:

        }
    } else {
        $tpl->assign('LAYOUT_COLORS_BLOCK', '');
    }
}
/************************************************************************************
 * Main script
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptStart);
check_login('user');
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'client/layout.tpl', 'page_message' => 'layout', 'layout_colors_block' => 'page', 'layout_color_block' => 'layout_colors_block'));
/**
 * Dispatches request
 */
if (isset($_POST['uaction'])) {
    if ($_POST['uaction'] == 'changeLayoutColor' && isset($_POST['layoutColor'])) {
        if (layout_setUserLayoutColor($_SESSION['user_id'], $_POST['layoutColor'])) {
            if (!isset($_SESSION['logged_from_id'])) {
                $_SESSION['user_theme_color'] = $_POST['layoutColor'];
                set_page_message(tr('Layout color successfully updated.'), 'success');
            } else {
                set_page_message(tr("Customer's layout color successfully updated."), 'success');
            }
        } else {
            set_page_message(tr('Unknown layout color.'), 'error');
        }
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:layout.php

示例15: showBadRequestErrorPage

            set_page_message(tr('Htaccess user successfully deleted from the %s htaccess group ', $stmt->fields['ugroup']), 'success');
        } else {
            return;
        }
    } else {
        return;
    }
}
/*************************************************************************
 * Main script
 */
// Include core library
require_once 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptStart);
check_login('user');
customerHasFeature('protected_areas') or showBadRequestErrorPage();
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'client/puser_assign.tpl', 'page_message' => 'layout', 'already_in' => 'page', 'grp_avlb' => 'page', 'add_button' => 'page', 'remove_button' => 'page', 'in_group' => 'page', 'not_in_group' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => 'Client / Webtools / Protected Areas / Manage Users and Groups / Assign Group', 'TR_SELECT_GROUP' => tr('Select group'), 'TR_MEMBER_OF_GROUP' => tr('Member of group'), 'TR_ADD' => tr('Add'), 'TR_REMOVE' => tr('Remove'), 'TR_CANCEL' => tr('Cancel')));
generateNavigation($tpl);
$dmn_id = get_user_domain_id($_SESSION['user_id']);
client_addHtaccessUserToHtaccessGroup($dmn_id);
client_removeHtaccessUserFromHtaccessGroup($dmn_id);
client_generatePage($tpl, $dmn_id);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:protected_user_assign.php


注:本文中的iMSCP_pTemplate::define_dynamic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。