<?php global $DETDB; add_rule(array('code' => 'calendar_event_admin', 'desc' => 'Возможность управления событиями')); give_rule('calendar_event_admin', 'admin'); $DETDB->create_table('calendar_events', array('ID' => 'int NOT NULL AUTO_INCREMENT PRIMARY KEY', 'date_start' => 'DATETIME', 'date_end' => 'DATETIME', 'name' => 'TEXT', 'place' => 'VARCHAR(255)', 'worker' => 'VARCHAR(255)', 'date_params' => 'VARCHAR(14)')); add_option(array('code' => 'calendar_events_range', 'name' => 'Поиск пересечений', 'value' => 1));
//DEL RULE if ($protectedPost['SUP_PROF'] != "") { delete_rule($protectedPost['SUP_PROF']); $tab_options['CACHE'] = 'RESET'; } //ADD new rule if ($protectedPost['ADD_RULE']) { add_rule($protectedPost['RULE_NAME'], $protectedPost); $tab_options['CACHE'] = 'RESET'; } //modif rule if ($protectedPost['MODIF_RULE']) { $name_exist = verify_name($protectedPost['RULE_NAME'], "and rule != " . $protectedPost['OLD_MODIF']); if ($name_exist == 'NAME_NOT_EXIST') { delete_rule($protectedPost['OLD_MODIF']); add_rule($protectedPost['RULE_NAME'], $protectedPost, $protectedPost['OLD_MODIF']); echo msg_success($l->g(711)); $tab_options['CACHE'] = 'RESET'; } else { msg_error($l->g(670)); } } //form name $form_name = "rules"; //show all rules echo open_form($form_name); $list_fields = array('ID_RULE' => 'RULE', 'RULE_NAME' => 'RULE_NAME', 'SUP' => 'RULE', 'MODIF' => 'RULE'); $table_name = "DOWNLOAD_AFFECT_RULES"; $default_fields = array('ID_RULE' => 'ID_RULE', 'RULE_NAME' => 'RULE_NAME', 'SUP' => 'SUP', 'MODIF' => 'MODIF'); $list_col_cant_del = array('ID_RULE' => 'ID_RULE', 'SUP' => 'SUP', 'MODIF' => 'MODIF'); $sql = prepare_sql_tab($list_fields, array('SUP'));
check_admin_authorization(); update_rule(); $ruleset_id = $_POST['ruleset_id1']; header("Location: index.php?editor=server&ruleset_id={$ruleset_id}&action=28"); exit; case 19: // Add Rule check_admin_authorization(); $breadcrumbs .= " >> " . "<a href='index.php?editor=server&action=16'>" . "Rules</a> >> Add Rule"; $body = new Template("templates/server/rules.add.tmpl.php"); $body->set('suggestruleset', $_GET['ruleset_id']); break; case 20: // Add Rule check_admin_authorization(); add_rule(); $ruleset_id = $_POST['ruleset_id']; header("Location: index.php?editor=server&ruleset_id={$ruleset_id}&action=28"); exit; case 21: // Delete Rule check_admin_authorization(); delete_rule(); $ruleset_id = $_GET['ruleset_id']; header("Location: index.php?editor=server&ruleset_id={$ruleset_id}&action=28"); exit; case 22: // Edit Ruleset check_admin_authorization(); $breadcrumbs .= " >> " . "<a href='index.php?editor=server&action=16'>" . "Rules</a> >> Ruleset Editor"; $body = new Template("templates/server/ruleset.edit.tmpl.php");
} } echo ajax_make_res('error', 'Произошла неизвестная ошибка', 'Ошибка!'); })); add_action(array('code' => 'ajax_delete_rule', 'category' => 'admin', 'rule' => 'admin_ajax, admin_settings', 'function' => function ($params = null) { if (isset($params['window']['pre_window']['value']) && $params['window']['pre_window']['type'] == 'code' && delete_rule($params['window']['pre_window']['value'])) { echo ajax_make_res('success', 'Право успешно удалено', 'Успех!'); } else { echo ajax_make_res('error', 'Произошла неизвестная ошибка', 'Ошибка!'); } })); add_action(array('code' => 'ajax_add_rule', 'category' => 'admin', 'rule' => 'admin_ajax, admin_settings', 'function' => function ($params = null) { if (isset($params['window']['input'])) { $params = $params['window']['input']; } if (isset($params['code']) && add_rule($params)) { echo ajax_make_res('reload', 'Право успешно добавлено', 'Успех!'); } else { echo ajax_make_res('error', 'Поле кода обязательно для заполнения', 'Ошибка!'); } })); add_action(array('code' => 'edit_user', 'function' => 'action_edit_user', 'rule' => 'admin_users', 'zone' => 'before_template', 'category' => 'admin', 'auto' => 'edit_user')); function action_edit_user() { global $PAGE; $current = isset($_GET['user_id']) && is_numeric($_GET['user_id']) ? $_GET['user_id'] : null; if (!$current) { $PAGE->title = 'Добавить пользователя'; } if (isset($_POST['action']) && $_POST['action'] == 'save') { $temp = $res = array('login' => '', 'code' => '', 'display_name' => '', 'mail' => '', 'groups_ID' => array(), 'rules' => array());