* 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. * * @link http://www.easyscp.net * @author EasySCP Team */ require '../../include/easyscp-lib.php'; check_login(__FILE__); $cfg = EasySCP_Registry::get('Config'); $tpl = EasySCP_TemplateEngine::getInstance(); $template = 'client/protected_areas_add.tpl'; $dmn_id = get_user_domain_id($_SESSION['user_id']); protect_area($tpl, $sql, $dmn_id); gen_protect_it($tpl, $sql, $dmn_id); // static page messages gen_logged_from($tpl); check_permissions($tpl); $tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Client/Webtools'), 'TR_HTACCESS' => tr('Protected areas'), 'TR_PROTECT_DIR' => tr('Protect this area'), 'TR_PATH' => tr('Path'), 'TR_USER' => tr('Users'), 'TR_GROUPS' => tr('Groups'), 'TR_PROTECT_IT' => tr('Protect it'), 'TR_USER_AUTH' => tr('User auth'), 'TR_GROUP_AUTH' => tr('Group auth'), 'TR_AREA_NAME' => tr('Area name'), 'TR_PROTECT_IT' => tr('Protect it'), 'TR_UNPROTECT_IT' => tr('Unprotect it'), 'TR_AREA_NAME' => tr('Area name'), 'TR_CANCEL' => tr('Cancel'), 'TR_MANAGE_USRES' => tr('Manage users and groups'), 'CHOOSE_DIR' => tr('Choose dir'))); gen_client_mainmenu($tpl, 'client/main_menu_webtools.tpl'); gen_client_menu($tpl, 'client/menu_webtools.tpl'); gen_page_message($tpl); if ($cfg->DUMP_GUI_DEBUG) { dump_gui_debug($tpl); } $tpl->display($template); unset_messages(); /** * @todo use db prepared statements
$grp_selected = ''; } } $tpl->assign(array('GROUP_VALUE' => $rs->fields['id'], 'GROUP_LABEL' => tohtml($rs->fields['ugroup']), 'GROUP_SELECTED' => $grp_selected)); $tpl->parse('GROUP_ITEM', '.group_item'); $rs->moveNext(); } } } /************************************************************************* * 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/protect_it.tpl', 'page_message' => 'layout', 'group_item' => 'page', 'user_item' => 'page', 'unprotect_it' => 'page')); $tpl->assign(array('TR_PAGE_TITLE' => tr('Client / Webtools / Protected Areas / {TR_DYNAMIC_TITLE}'), 'TR_FTP_DIRECTORIES' => tojs('Ftp directories'), 'TR_CLOSE' => tojs(tr('Close')), 'TR_DYNAMIC_TITLE' => isset($_GET['id']) ? tr('Edit protected area') : tr('Add protected area'), 'TR_PROTECTED_AREA' => tr('Protected areas'), 'TR_AREA_NAME' => tr('Area name'), 'TR_PATH' => tr('Path'), 'CHOOSE_DIR' => tr('Choose dir'), 'TR_USER' => tr('Users'), 'TR_GROUPS' => tr('Groups'), 'TR_USER_AUTH' => tr('User auth'), 'TR_GROUP_AUTH' => tr('Group auth'), 'TR_PROTECT_IT' => tr('Protect it'), 'TR_UNPROTECT_IT' => tr('Unprotect it'), 'TR_CANCEL' => tr('Cancel'), 'TR_MANAGE_USERS_AND_GROUPS' => tr('Users and groups'))); generateNavigation($tpl); $domainId = get_user_domain_id($_SESSION['user_id']); protect_area($domainId); gen_protect_it($tpl, get_user_domain_id($domainId)); generatePageMessage($tpl); $tpl->parse('LAYOUT_CONTENT', 'page'); iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptEnd, array('templateEngine' => $tpl)); $tpl->prnt(); unsetMessages();