Index: branches/RC/core/install/upgrades.sql =================================================================== diff -u -N -r10923 -r10941 --- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 10923) +++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 10941) @@ -369,4 +369,8 @@ PRIMARY KEY (ThesaurusId), KEY ThesaurusType (ThesaurusType), KEY SearchTerm (SearchTerm) -); \ No newline at end of file +); + +INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.delete', 11, 1, 1, 0); +INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.edit', 11, 1, 1, 0); +INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.add', 11, 1, 1, 0); Index: branches/RC/core/units/ban_rules/ban_rules_config.php =================================================================== diff -u -N --- branches/RC/core/units/ban_rules/ban_rules_config.php (revision 0) +++ branches/RC/core/units/ban_rules/ban_rules_config.php (revision 10941) @@ -0,0 +1,108 @@ + 'ban-rule', + 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), + + 'AutoLoad' => true, + + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'event', + 4 => 'mode', + ), + + 'IDField' => 'RuleId', + + 'TableName' => TABLE_PREFIX.'BanRules', + + 'TitleField' => 'ItemValue', + + 'TitlePresets' => Array ( + 'default' => Array ( + 'new_status_labels' => Array ('ban-rule' => '!la_title_AddingBanRule!'), + 'edit_status_labels' => Array ('ban-rule' => '!la_title_EditingBanRule!'), + ), + + 'ban_rule_list' => Array ('prefixes' => Array ('ban-rule_List'), 'format' => "!la_tab_BanList! (#ban-rule_recordcount#)"), + 'ban_rule_edit' => Array ('prefixes' => Array ('ban-rule'), 'format' => "#ban-rule_status# '#ban-rule_titlefield#'"), + ), + + 'PermSection' => Array('main' => 'in-portal:ban_rules'), + + 'Sections' => Array ( + 'in-portal:ban_rulelist' => Array ( + 'parent' => 'in-portal:users', + 'icon' => 'in-portal:banlist', + 'label' => 'la_tab_BanList', + 'url' => Array('t' => 'ban_rules/ban_rule_list', 'pass' => 'm'), + 'permissions' => Array ('view', 'add', 'edit', 'delete'), + 'priority' => 6, + 'type' => stTREE, + ), + ), + + 'ListSQLs' => Array ( + '' => ' SELECT %1$s.* %2$s FROM %1$s', + ), + + 'ListSortings' => Array ( + '' => Array ( + 'Sorting' => Array ('Priority' => 'desc'), + ) + ), + + 'Fields' => Array ( + 'RuleId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'RuleType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array( + 0 => 'la_opt_Deny', +// 1 => 'la_opt_Allow' + ) + ), + 'ItemField' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array( + 'ip' => 'la_opt_IP_Address', + 'Login' => 'la_opt_Username', + 'Email' => 'la_opt_Email', + 'FirstName' => 'la_opt_FirstName', + 'LastName' => 'la_opt_LastName', + 'Address' => 'la_opt_Address', + 'City' => 'la_opt_City', + 'State' => 'la_opt_State', + 'Zip' => 'la_opt_Zip', + 'Phone' => 'la_opt_Phone', + ) + ), + 'ItemVerb' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array( + 1 => 'la_opt_Exact', + 3 => 'la_opt_Sub-match' + ) + ), + 'ItemValue' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required'=>1, 'default' => ''), + 'ItemType' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Status' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1, 'use_phrases' => 1, 'formatter'=>'kOptionsFormatter', 'options'=>Array( + 1 => 'la_Enabled', + 0 => 'la_Disabled' + ) + ), + 'ErrorTag' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL), + ), + + 'Grids' => Array ( + 'Default' => Array ( + 'Icons' => Array ('default' => 'icon16_custom.gif'), + 'Fields' => Array ( + 'RuleId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ), + 'RuleType' => Array ('title' => 'la_col_RuleType', 'filter_block' => 'grid_options_filter', ), + 'ItemField' => Array ('title' => 'la_col_ItemField', 'filter_block' => 'grid_options_filter', ), + 'ItemVerb' => Array ('title' => 'la_col_FieldComparision', 'filter_block' => 'grid_options_filter', ), + 'ItemValue' => Array ('title' => 'la_col_FieldValue', 'filter_block' => 'grid_like_filter', ), + 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', ), + ), + ), + ), + ); \ No newline at end of file Index: branches/RC/core/install/english.lang =================================================================== diff -u -N -r10923 -r10941 --- branches/RC/core/install/english.lang (.../english.lang) (revision 10923) +++ branches/RC/core/install/english.lang (.../english.lang) (revision 10941) @@ -1,23 +1,31 @@ m/d/Yg:i:s Am/d/Yg:i:s A.,iso-8859-12 + RmllbGQgQ29tcGFyaXNpb24= + RmllbGQgVmFsdWU= + SXRlbSBGaWVsZA== TGFzdCBSdW4gT24= TGFzdCBSdW4gU3RhdHVz TWlzc3BlbGxlZCBXb3Jk TmV4dCBSdW4gT24= + UnVsZSBUeXBl UnVuIEludGVydmFs UnVuIE1vZGU= U2VhcmNoIFRlcm0= U3VnZ2VzdGVkIENvcnJlY3Rpb24= VGhlc2F1cnVzIFRlcm0= VGhlc2F1cnVzIFR5cGU= RmlsZW5hbWUgU3BlY2lhbCBDaGFyIFJlcGxhY2VtZW50 + RXJyb3IgVGFn RXZlbnQ= + RmllbGQgVmFsdWU= RmlsZW5hbWUgUmVwbGFjZW1lbnRz + SXRlbSBGaWVsZA== TGFzdCBSdW4gT24= TGFzdCBSdW4gU3RhdHVz TWlzc3BlbGxlZCBXb3Jk TmV4dCBSdW4gT24= + UnVsZSBUeXBl UnVuIEludGVydmFs UnVuIE1vZGU= UnVuIFRpbWU= @@ -27,18 +35,33 @@ VGhlc2F1cnVzIFR5cGU= VHlwZQ== QWN0aXZl + QWRkcmVzcw== QWZ0ZXI= + QWxsb3c= QmVmb3Jl + Q2l0eQ== + RGVueQ== RGlzYWJsZWQ= + RXhhY3Q= RmFpbGVk + Rmlyc3QgTmFtZQ== + SVAgQWRkcmVzcw== + TGFzdCBOYW1l + UGhvbmU= UnVubmluZw== + U3RhdGU= + U3ViLW1hdGNo U3VjY2Vzcw== U3lzdGVt VXNlcg== + VXNlcm5hbWU= + Wmlw QWRkaW5nIEFnZW50 + QWRkaW5nIEJhbiBSdWxl QWRkaW5nIFNwZWxsaW5nIERpY3Rpb25hcnk= QWdlbnRz RWRpdGluZyBBZ2VudA== + RWRpdGluZyBCYW4gUnVsZQ== RWRpdGluZyBTcGVsbGluZyBEaWN0aW9uYXJ5 TmV3IEFnZW50 U3BlbGxpbmcgRGljdGlvbmFyeQ== Index: branches/RC/core/install/install_data.sql =================================================================== diff -u -N -r10908 -r10941 --- branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 10908) +++ branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 10941) @@ -635,6 +635,11 @@ INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:agents.view', 11, 1, 1, 0); +INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.delete', 11, 1, 1, 0); +INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.edit', 11, 1, 1, 0); +INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:ban_rulelist.add', 11, 1, 1, 0); + + INSERT INTO Skins VALUES (DEFAULT, 'Default', '/* General elements */\r\n\r\nhtml {\r\n height: 100%;\r\n}\r\n\r\nbody {\r\n font-family: verdana,arial,helvetica,sans-serif;\r\n font-size: 9pt;\r\n color: #000000;\r\n overflow-x: auto; overflow-y: auto;\r\n margin: 0px 0px 0px 0px;\r\n text-decoration: none;\r\n}\r\n\r\na {\r\n color: #006699;\r\n text-decoration: none;\r\n}\r\n\r\na:hover {\r\n color: #009ff0;\r\n text-decoration: none;\r\n}\r\n\r\nform {\r\n display: inline;\r\n}\r\n\r\nimg { border: 0px; }\r\n\r\nbody.height-100 {\r\n height: 100%;\r\n}\r\n\r\nbody.regular-body {\r\n margin: 0px 10px 5px 10px;\r\n color: #000000;\r\n background-color: @@SectionBgColor@@;\r\n}\r\n\r\nbody.edit-popup {\r\n margin: 0px 0px 0px 0px;\r\n}\r\n\r\ntable.collapsed {\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered, table.bordered, .bordered-no-bottom {\r\n border: 1px solid #000000;\r\n border-collapse: collapse;\r\n}\r\n\r\n.bordered-no-bottom {\r\n border-bottom: none;\r\n}\r\n\r\n.login-table td {\r\n padding: 1px;\r\n}\r\n\r\n.disabled {\r\n background-color: #ebebeb;\r\n}\r\n\r\n/* Head frame */\r\n.head-table tr td {\r\n background-color: @@HeadBgColor@@;\r\n color: @@HeadColor@@\r\n}\r\n\r\ntd.kx-block-header, .head-table tr td.kx-block-header{\r\n color: @@HeadBarColor@@;\r\n background-color: @@HeadBarBgColor@@;\r\n padding-left: 7px;\r\n padding-right: 7px;\r\n}\r\n\r\na.kx-header-link {\r\n text-decoration: underline;\r\n color: #FFFFFF;\r\n}\r\n\r\na.kx-header-link:hover {\r\n color: #FFCB05;\r\n text-decoration: none;\r\n}\r\n\r\n.kx-secondary-foreground {\r\n color: @@HeadBarColor@@;\r\n background-color: @@HeadBarBgColor@@;\r\n}\r\n\r\n.kx-login-button {\r\n background-color: #2D79D6;\r\n color: #FFFFFF;\r\n}\r\n\r\n/* General form button (yellow) */\r\n.button {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #000000;\r\n background: url(@@base_url@@/proj-base/admin_templates/img/button_back.gif) #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Disabled (grayed-out) form button */\r\n.button-disabled {\r\n font-size: 12px;\r\n font-weight: normal;\r\n color: #676767;\r\n background: url(@@base_url@@/proj-base/admin_templates/img/button_back_disabled.gif) #f9eeae repeat-x;\r\n text-decoration: none;\r\n}\r\n\r\n/* Tabs bar */\r\n\r\n.tab, .tab-active {\r\n background-color: #F0F1EB;\r\n padding: 3px 7px 2px 7px;\r\n border-top: 1px solid black;\r\n border-left: 1px solid black;\r\n border-right: 1px solid black;\r\n}\r\n\r\n.tab-active {\r\n background-color: #2D79D6;\r\n border-bottom: 1px solid #2D79D6;\r\n}\r\n\r\n.tab a {\r\n color: #00659C;\r\n font-weight: bold;\r\n}\r\n\r\n.tab-active a {\r\n color: #fff;\r\n font-weight: bold;\r\n}\r\n\r\n\r\n/* Toolbar */\r\n\r\n.toolbar {\r\n font-size: 8pt;\r\n border: 1px solid #000000;\r\n border-width: 0px 1px 1px 1px;\r\n background-color: @@ToolbarBgColor@@;\r\n border-collapse: collapse;\r\n}\r\n\r\n.toolbar td {\r\n height: 100%;\r\n}\r\n\r\n.toolbar-button, .toolbar-button-disabled, .toolbar-button-over {\r\n float: left;\r\n text-align: center;\r\n font-size: 8pt;\r\n padding: 5px 5px 5px 5px;\r\n vertical-align: middle;\r\n color: #006F99;\r\n}\r\n\r\n.toolbar-button-over {\r\n color: #000;\r\n}\r\n\r\n.toolbar-button-disabled {\r\n color: #444;\r\n}\r\n\r\n/* Scrollable Grids */\r\n\r\n\r\n.layout-only-table td {\r\n border: none !important;\r\n}\r\n\r\n/* Main Grid class */\r\n.grid-scrollable {\r\n padding: 0px;\r\n border: 1px solid black !important;\r\n border-top: none !important;\r\n}\r\n\r\n/* Div generated by js, which contains all the scrollable grid elements, affects the style of scrollable area without data (if there are too few rows) */\r\n.grid-container {\r\n background-color: #fff;\r\n}\r\n\r\n.grid-container table {\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Inner div generated in each data-cell */\r\n.grid-cell-div {\r\n overflow: hidden;\r\n height: auto;\r\n}\r\n\r\n/* Main row definition */\r\n.grid-data-row td, .grid-data-row-selected td, .grid-data-row-even-selected td, .grid-data-row-mouseover td, .table-color1, .table-color2 {\r\n font-weight: normal;\r\n color: @@OddColor@@;\r\n background-color: @@OddBgColor@@;\r\n padding: 3px 5px 3px 5px;\r\n overflow: hidden;\r\n border-right: 1px solid #c9c9c9;\r\n}\r\n.grid-data-row-even td, .table-color2 {\r\n background-color: @@EvenBgColor@@;\r\n color: @@EvenColor@@;\r\n}\r\n.grid-data-row td a, .grid-data-row-selected td a, .grid-data-row-mouseover td a {\r\n text-decoration: underline;\r\n}\r\n\r\n/* mouse-over rows */\r\n.grid-data-row-mouseover td, table tr.grid-data-row[_row_highlighted] td {\r\n background: #FFFDF4;\r\n}\r\n\r\n/* Selected row, applies to both checkbox and data areas */\r\n.grid-data-row-selected td, table tr.grid-data-row[_row_selected] td {\r\n background: #FEF2D6;\r\n}\r\n\r\n.grid-data-row-even-selected td, .grid-data-row-even[_row_selected] td {\r\n background: #FFF7E0;\r\n}\r\n\r\n/* General header cell definition */\r\n.grid-header-row td {\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n text-decoration: none;\r\n padding: 3px 5px 3px 5px;\r\n color: @@ColumnTitlesColor@@;\r\n border-right: none;\r\n text-align: left;\r\n vertical-align: middle !important;\r\n white-space: nowrap;\r\n border-right: 1px solid #777;\r\n}\r\n\r\n/* Filters row */\r\ntr.grid-header-row-0 td {\r\n background-color: @@FiltersBgColor@@;\r\n border-bottom: 1px solid black;\r\n}\r\n\r\n/* Grid Filters */\r\ntable.range-filter {\r\n width: 100%;\r\n}\r\n\r\n.range-filter td {\r\n padding: 0px 0px 2px 2px !important;\r\n border: none !important;\r\n font-size: 8pt !important;\r\n font-weight: normal !important;\r\n text-align: left;\r\n color: #000000 !important;\r\n}\r\n\r\ninput.filter, select.filter, input.filter-active, select.filter-active {\r\n margin-bottom: 0px;\r\n border: 1px solid #aaa;\r\n}\r\n\r\ninput.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\nselect.filter-active {\r\n background-color: #FFFF00;\r\n}\r\n\r\n/* Column titles row */\r\ntr.grid-header-row-1 td {\r\n height: 25px;\r\n font-weight: bold;\r\n background-color: @@ColumnTitlesBgColor@@;\r\n color: @@ColumnTitlesColor@@;\r\n}\r\n\r\ntr.grid-header-row-1 td a {\r\n color: @@ColumnTitlesColor@@;\r\n}\r\n\r\ntr.grid-header-row-1 td a:hover {\r\n color: #FFCC00;\r\n}\r\n\r\n\r\n.grid-footer-row td {\r\n background-color: #D7D7D7;\r\n font-weight: bold;\r\n border-right: none;\r\n padding: 3px 5px 3px 5px;\r\n}\r\n\r\ntd.grid-header-last-cell, td.grid-data-last-cell, td.grid-footer-last-cell {\r\n border-right: none !important;\r\n}\r\n\r\ntd.grid-data-col-0, td.grid-data-col-0 div {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-0 td.grid-header-col-0 {\r\n text-align: center;\r\n vertical-align: middle !important;\r\n}\r\n\r\ntr.grid-header-row-0 td.grid-header-col-0 div {\r\n display: table-cell;\r\n vertical-align: middle;\r\n}\r\n\r\n.grid-status-bar {\r\n border: 1px solid black;\r\n border-top: none;\r\n padding: 0px;\r\n width: 100%;\r\n border-collapse: collapse;\r\n height: 30px;\r\n}\r\n\r\n.grid-status-bar td {\r\n background-color: @@TitleBarBgColor@@;\r\n color: @@TitleBarColor@@;\r\n font-size: 11pt;\r\n font-weight: normal;\r\n padding: 2px 8px 2px 8px;\r\n}\r\n\r\n/* /Scrollable Grids */\r\n\r\n\r\n/* Forms */\r\ntable.edit-form {\r\n border: none;\r\n border-top-width: 0px;\r\n border-collapse: collapse;\r\n width: 100%;\r\n}\r\n\r\n.edit-form-odd, .edit-form-even {\r\n padding: 0px;\r\n}\r\n\r\n.subsectiontitle {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #4A92CE;\r\n color: #fff;\r\n height: 25px;\r\n border-top: 1px solid black;\r\n vertical-align: middle;\r\n}\r\n\r\n.subsectiontitle td {\r\n vertical-align: middle;\r\n padding: 3px 5px 3px 5px;\r\n}\r\n\r\n.label-cell {\r\n background: #DEE7F6 url(@@base_url@@/proj-base/admin_templates/img/bgr_input_name_line.gif) no-repeat right bottom;\r\n font: 12px arial, sans-serif;\r\n padding: 4px 20px;\r\n width: 150px;\r\n}\r\n\r\n.control-mid {\r\n width: 13px;\r\n border-left: 1px solid #7A95C2;\r\n background: #fff url(@@base_url@@/proj-base/admin_templates/img/bgr_mid.gif) repeat-x left bottom;\r\n}\r\n\r\n.control-cell {\r\n font: 11px arial, sans-serif;\r\n padding: 4px 10px 5px 5px;\r\n background: #fff url(@@base_url@@/proj-base/admin_templates/img/bgr_input_line.gif) no-repeat left bottom;\r\n width: auto;\r\n vertical-align: middle;\r\n}\r\n\r\n.label-cell-filler {\r\n background: #DEE7F6 none;\r\n}\r\n.control-mid-filler {\r\n background: #fff none;\r\n border-left: 1px solid #7A95C2;\r\n}\r\n.control-cell-filler {\r\n background: #fff none;\r\n}\r\n\r\n.error {\r\n color: red;\r\n}\r\n.error-cell {\r\n color: red;\r\n}\r\n\r\n.field-required {\r\n color: red;\r\n}\r\n\r\n.form-warning {\r\n color: red;\r\n}\r\n\r\n.req-note {\r\n font-style: italic;\r\n color: #333;\r\n}\r\n\r\n#scroll_container table.tableborder {\r\n border-collapse: separate\r\n}\r\n\r\n\r\n/* Uploader */\r\n\r\n.uploader-main {\r\n position: absolute;\r\n display: none;\r\n z-index: 10;\r\n border: 1px solid #777;\r\n padding: 10px;\r\n width: 350px;\r\n height: 120px;\r\n overflow: hidden;\r\n background-color: #fff;\r\n}\r\n\r\n.uploader-percent {\r\n width: 100%;\r\n padding-top: 3px;\r\n text-align: center;\r\n position: relative;\r\n z-index: 20;\r\n float: left;\r\n font-weight: bold;\r\n}\r\n\r\n.uploader-left {\r\n width: 100%;\r\n border: 1px solid black;\r\n height: 20px;\r\n background: #fff url(@@base_url@@/core/admin_templates/img/progress_left.gif);\r\n}\r\n\r\n.uploader-done {\r\n width: 0%;\r\n background-color: green;\r\n height: 20px;\r\n background: #4A92CE url(@@base_url@@/core/admin_templates/img/progress_done.gif);\r\n}\r\n\r\n\r\n/* To be sorted */\r\n\r\n\r\n/* Section title, right to the big icon */\r\n.admintitle {\r\n font-size: 16pt;\r\n font-weight: bold;\r\n color: @@SectionColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Left sid of bluebar */\r\n.header_left_bg {\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n padding-left: 5px;\r\n}\r\n\r\n/* Right side of bluebar */\r\n.tablenav, tablenav a {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n\r\n text-decoration: none;\r\n background-color: @@TitleBarBgColor@@;\r\n background-image: none;\r\n}\r\n\r\n/* Section title in the bluebar * -- why ''link''? :S */\r\n.tablenav_link {\r\n font-size: 11pt;\r\n font-weight: bold;\r\n color: @@TitleBarColor@@;\r\n text-decoration: none;\r\n}\r\n\r\n/* Active page in top and bottom bluebars pagination */\r\n.current_page {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n background-color: #fff;\r\n color: #2D79D6;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Other pages and arrows in pagination on blue */\r\n.nav_url {\r\n font-size: 10pt;\r\n font-weight: bold;\r\n color: #fff;\r\n padding: 3px 2px 3px 3px;\r\n}\r\n\r\n/* Tree */\r\n.tree-body {\r\n background-color: @@TreeBgColor@@;\r\n height: 100%\r\n}\r\n\r\n.tree_head.td, .tree_head, .tree_head:hover {\r\n font-weight: bold;\r\n font-size: 10px;\r\n color: #FFFFFF;\r\n font-family: Verdana, Arial;\r\n text-decoration: none;\r\n}\r\n\r\n.tree {\r\n padding: 0px;\r\n border: none;\r\n border-collapse: collapse;\r\n}\r\n\r\n.tree tr td {\r\n padding: 0px;\r\n margin: 0px;\r\n font-family: helvetica, arial, verdana,;\r\n font-size: 11px;\r\n white-space: nowrap;\r\n}\r\n\r\n.tree tr td a {\r\n font-size: 11px;\r\n color: @@TreeColor@@;\r\n font-family: Helvetica, Arial, Verdana;\r\n text-decoration: none;\r\n padding: 2px 0px 2px 2px;\r\n}\r\n\r\n.tree tr.highlighted td a {\r\n background-color: @@TreeHighBgColor@@;\r\n color: @@TreeHighColor@@;\r\n}\r\n\r\n.tree tr.highlighted td a:hover {\r\n color: #fff;\r\n}\r\n\r\n.tree tr td a:hover {\r\n color: #000000;\r\n}', 'just_logo_1.gif', 'a:20:{s:11:"HeadBgColor";a:2:{s:11:"Description";s:27:"Head frame background color";s:5:"Value";s:7:"#1961B8";}s:9:"HeadColor";a:2:{s:11:"Description";s:21:"Head frame text color";s:5:"Value";s:7:"#CCFF00";}s:14:"SectionBgColor";a:2:{s:11:"Description";s:28:"Section bar background color";s:5:"Value";s:7:"#FFFFFF";}s:12:"SectionColor";a:2:{s:11:"Description";s:22:"Section bar text color";s:5:"Value";s:7:"#2D79D6";}s:12:"HeadBarColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:14:"HeadBarBgColor";a:1:{s:5:"Value";s:7:"#1961B8";}s:13:"TitleBarColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TitleBarBgColor";a:1:{s:5:"Value";s:7:"#2D79D6";}s:14:"ToolbarBgColor";a:1:{s:5:"Value";s:7:"#F0F1EB";}s:14:"FiltersBgColor";a:1:{s:5:"Value";s:7:"#D7D7D7";}s:17:"ColumnTitlesColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:19:"ColumnTitlesBgColor";a:1:{s:5:"Value";s:7:"#999999";}s:8:"OddColor";a:1:{s:5:"Value";s:7:"#000000";}s:10:"OddBgColor";a:1:{s:5:"Value";s:7:"#F6F6F6";}s:9:"EvenColor";a:1:{s:5:"Value";s:7:"#000000";}s:11:"EvenBgColor";a:1:{s:5:"Value";s:7:"#EBEBEB";}s:9:"TreeColor";a:1:{s:5:"Value";s:7:"#006F99";}s:11:"TreeBgColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:13:"TreeHighColor";a:1:{s:5:"Value";s:7:"#FFFFFF";}s:15:"TreeHighBgColor";a:1:{s:5:"Value";s:7:"#4A92CE";}}', 1206520493, 1); Index: branches/RC/core/admin_templates/ban_rules/ban_rule_edit.tpl =================================================================== diff -u -N --- branches/RC/core/admin_templates/ban_rules/ban_rule_edit.tpl (revision 0) +++ branches/RC/core/admin_templates/ban_rules/ban_rule_edit.tpl (revision 10941) @@ -0,0 +1,78 @@ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + + + + + + + + " id="" value="6"> + +
+
+ + Index: branches/RC/core/units/users/users_event_handler.php =================================================================== diff -u -N -r10539 -r10941 --- branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 10539) +++ branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 10941) @@ -248,6 +248,10 @@ if ($user_id) { $object->Load($user_id); + if (!$this->checkBanRules($object)) { + $event->status = erFAIL; + return false; + } if ($object->GetDBField('Status') == STATUS_ACTIVE) { $groups = $object->getMembershipGroups(true); if(!$groups) $groups = Array(); @@ -690,6 +694,10 @@ { $email_as_login = $this->Application->ConfigValue('Email_As_Login'); $object =& $event->getObject(); + if (!$this->checkBanRules($object)) { + $event->status = erFAIL; + return false; + } if ($email_as_login) { $object->Fields['Email']['error_msgs']['unique'] = $this->Application->Phrase('lu_user_and_email_already_exist'); } @@ -1646,6 +1654,78 @@ $image_helper->SaveItemImages($object); } } + + /** + * Check user fields + * + * @param kDBItem $object + */ + function checkBanRules(&$object) + { + $sql = 'SELECT * FROM '.TABLE_PREFIX.'BanRules WHERE ItemType=6 AND Status=1 ORDER BY Priority DESC'; + $a_rules = $this->Conn->Query($sql); + $found = FALSE; + foreach($a_rules as $a_rule) { + $field = $a_rule['ItemField']; + if(isset($object->Fields[$field])) { + $ThisValue = strtolower($object->GetDBField($field)); + $TestValue = strtolower($a_rule['ItemValue']); + switch($a_rule['ItemVerb']) + { +// case 0: /* any */ +// $found = TRUE; +// break; + case 1: /* is */ + if ($ThisValue==$TestValue) { + $found = TRUE; + } + break; +// case 2: /* is not */ +// if($ThisValue != $TestValue) +// $found = TRUE; +// break; + case 3: /* contains */ + if(strstr($ThisValue,$TestValue)) { + $found = TRUE; + } + break; +// case 4: /* not contains */ +// if(!strstr($ThisValue,$TestValue)) +// $found = TRUE; +// break; +// case 5: /* Greater Than */ +// if($TestValue > $ThisValue) +// $found = TRUE; +// break; +// case 6: /* Less Than */ +// if($TestValue < $ThisValue) +// $found = TRUE; +// break; +// case 7: /* exists */ +// if(strlen($ThisValue)>0) +// $found = TRUE; +// break; +// case 8: /* unique */ +// if($this->ValueExists($field,$ThisValue)) +// $found = TRUE; +// break; + } + } + if($found) + { +// if($b->Get("RuleType")==0) +// { +// $MatchedRule = $b->Get("RuleId"); +// } +// else +// { +// $MatchedRule = 0; +// } + break; + } + } + return !$found; + } } ?> \ No newline at end of file Index: branches/RC/core/admin_templates/ban_rules/ban_rule_list.tpl =================================================================== diff -u -N --- branches/RC/core/admin_templates/ban_rules/ban_rule_list.tpl (revision 0) +++ branches/RC/core/admin_templates/ban_rules/ban_rule_list.tpl (revision 10941) @@ -0,0 +1,48 @@ + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file