You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(381) |
Nov
(176) |
Dec
(310) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(334) |
Feb
(96) |
Mar
(149) |
Apr
(214) |
May
(120) |
Jun
(56) |
Jul
(10) |
Aug
(273) |
Sep
(182) |
Oct
(56) |
Nov
(125) |
Dec
(22) |
2003 |
Jan
(63) |
Feb
(181) |
Mar
(498) |
Apr
(433) |
May
(39) |
Jun
(512) |
Jul
(276) |
Aug
(156) |
Sep
(101) |
Oct
(66) |
Nov
(24) |
Dec
(161) |
2004 |
Jan
(1) |
Feb
(377) |
Mar
(68) |
Apr
(26) |
May
(107) |
Jun
(333) |
Jul
(13) |
Aug
|
Sep
(76) |
Oct
(88) |
Nov
(170) |
Dec
(91) |
2005 |
Jan
(52) |
Feb
(239) |
Mar
(402) |
Apr
(15) |
May
(2) |
Jun
(1) |
Jul
(13) |
Aug
|
Sep
(71) |
Oct
(34) |
Nov
|
Dec
|
2006 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(7) |
Oct
(2) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris W. <la...@us...> - 2005-03-04 03:11:46
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15236 Modified Files: context.t manage_list_packages.t utils.pl Log Message: get rid of tests for package versions Index: context.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/context.t,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** context.t 2 Mar 2005 15:42:13 -0000 1.43 --- context.t 4 Mar 2005 03:11:21 -0000 1.44 *************** *** 69,76 **** 'Number of packages fetched by repository' ); ! my %package_versions = get_package_versions(); ! while ( my ( $pkg_name, $pkg_ver ) = each %package_versions ) { ! is( $repository->fetch_package( $pkg_name )->version, $pkg_ver, ! "Package '$pkg_name' version" ); } --- 69,75 ---- 'Number of packages fetched by repository' ); ! foreach my $pkg_name ( get_packages() ) { ! is( ref( $repository->fetch_package( $pkg_name ) ), 'OpenInteract2::Package' ! "Package '$pkg_name' exists" ); } Index: manage_list_packages.t =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/manage_list_packages.t,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** manage_list_packages.t 25 May 2004 00:13:30 -0000 1.13 --- manage_list_packages.t 4 Mar 2005 03:11:21 -0000 1.14 *************** *** 6,10 **** use lib 't/'; require 'utils.pl'; ! use Test::More tests => 37; require_ok( 'OpenInteract2::Manage' ); --- 6,10 ---- use lib 't/'; require 'utils.pl'; ! use Test::More tests => 23; require_ok( 'OpenInteract2::Manage' ); *************** *** 26,38 **** 'Correct number of packages listed' ); - my %package_versions = get_package_versions(); - my $count = 0; ! foreach my $package_name ( sort keys %package_versions ) { is( $status[$count]->{name}, $package_name, "Package " . ($count + 1) . " name correct ($package_name)" ); - my $version = $package_versions{ $package_name }; - is( $status[$count]->{version}, $version, - "Package " . ($count + 1) . " version correct ($version)" ); $count++; } --- 26,33 ---- 'Correct number of packages listed' ); my $count = 0; ! foreach my $package_name ( get_packages() ) { is( $status[$count]->{name}, $package_name, "Package " . ($count + 1) . " name correct ($package_name)" ); $count++; } Index: utils.pl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/utils.pl,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** utils.pl 3 Mar 2005 15:33:31 -0000 1.99 --- utils.pl 4 Mar 2005 03:11:21 -0000 1.100 *************** *** 43,65 **** } ! sub main::get_package_versions { ! return ( ! base => '2.15', ! base_box => '2.19', ! base_error => '3.02', ! base_group => '2.19', ! base_page => '2.30', ! base_security => '2.21', ! base_template => '3.17', ! base_theme => '2.13', ! base_user => '2.40', ! comments => '1.22', ! full_text => '2.61', ! lookup => '2.09', ! news => '2.24', ! object_activity => '2.13', ! system_doc => '2.10', ! whats_new => '2.12', ! ); } --- 43,51 ---- } ! sub main::get_packages { ! return qw( base base_box base_error base_group base_page ! base_security base_template base_theme base_user ! comments full_text lookup news object_activity ! system_doc whats_new ); } |
From: Chris W. <la...@us...> - 2005-03-04 03:03:26
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13491/Manual Modified Files: TutorialAdvanced.pod Log Message: OIN-92: add more information... Index: TutorialAdvanced.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/TutorialAdvanced.pod,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TutorialAdvanced.pod 26 Feb 2005 05:04:04 -0000 1.5 --- TutorialAdvanced.pod 4 Mar 2005 03:03:15 -0000 1.6 *************** *** 9,14 **** common) actions you can do with OpenInteract2. ! For the examples in this document we'll rely on the 'books' ! application created in L<OpenInteract2::Manual::Tutorial>. =head1 ACTIONS: SETTING UP A LOOKUP TABLE --- 9,14 ---- common) actions you can do with OpenInteract2. ! For the examples in this document we'll rely on the 'book' application ! created in L<OpenInteract2::Manual::Tutorial>. =head1 ACTIONS: SETTING UP A LOOKUP TABLE *************** *** 17,21 **** One of the immediate problems with our 'book' record is that there's ! no way to categorize them. Sure, most books are cross-category -- my favorite: 'Computer Programming' + 'Self-Help' -- but our books don't even have B<one>. --- 17,21 ---- One of the immediate problems with our 'book' record is that there's ! no way to categorize them. Sure, most books cross categories -- my favorite: 'Computer Programming' + 'Self-Help' -- but our books don't even have B<one>. *************** *** 132,137 **** =back ! See the documentation for the C<lookup> package for more information ! and additional options you can set. Add these files to your C<MANIFEST>, modify your C<Changes> and --- 132,137 ---- =back ! See L<OpenInteract2::App::Lookup> for more information and additional ! options you can set. Add these files to your C<MANIFEST>, modify your C<Changes> and *************** *** 163,171 **** =head2 Add field to table ! So now we need to add our category to the book table. Using whatever ! database tool you're comfortable with add the following definition: category_id int null When you restart the server all your 'book' objects will have the new property 'category_id'. Since we set 'field_discover' to 'yes' in the --- 163,176 ---- =head2 Add field to table ! So now we need to add our category our table of books. Using whatever ! database tool you're comfortable with add the following definition to ! the 'book' table: category_id int null + For instance, when I use PostgreSQL I just do: + + psql> ALTER TABLE book ADD category_id INT NULL; + When you restart the server all your 'book' objects will have the new property 'category_id'. Since we set 'field_discover' to 'yes' in the *************** *** 185,189 **** "_display_form_customize", etc. ! So in our action L<OpenInteract2/Action/Book.pm> we'll implement these callbacks. This is very similar to how we added our list of publishers to the search form but instead of plain strings as the source we're --- 190,194 ---- "_display_form_customize", etc. ! So in our action C<OpenInteract2/Action/Book.pm> we'll implement these callbacks. This is very similar to how we added our list of publishers to the search form but instead of plain strings as the source we're *************** *** 198,202 **** } ! And reference it: sub _display_add_customize { --- 203,207 ---- } ! And reference it from your callbacks: sub _display_add_customize { *************** *** 221,225 **** first_label = '---Categories---' ) -%] ! Assuming you have categrories: category_id category --- 226,230 ---- first_label = '---Categories---' ) -%] ! Assuming you have the following categrories: category_id category *************** *** 230,255 **** 4 Vegetarian Cooking ! You'll see something like this (remember that we sorted the categories ! when we assigned them to the template parameters): ! <select name="category_id"> ! <option value="">---Categories---</option> ! <option value="2">Perl</option> ! <option value="3">Regular Expressions</option> ! <option value="1">Self-Help</option> ! <option value="4">Vegetarian Cooking</option> ! </select> =head2 Add fields to action configuration ! Finally, since we configured our SPOPS object with 'field_discover' we ! didn't have to add the field to our SPOPS configuration. But since ! common action configurations don't have this feature yet you'll have ! to add to your C<conf/action.ini> under '[book]' these keys and ! values: c_update_fields = category_id c_add_fields = category_id =head1 ACTIONS: A TEMPLATE CAN BE AN ACTION --- 235,267 ---- 4 Vegetarian Cooking ! You'll see something like this -- remember that we sorted the ! categories by 'category' when we assigned them to the template ! parameters: ! <tr> ! <td><b>Category</b></td> ! <td><select name="category_id"> ! <option value="">---Categories---</option> ! <option value="2">Perl</option> ! <option value="3">Regular Expressions</option> ! <option value="1">Self-Help</option> ! <option value="4">Vegetarian Cooking</option> ! </select> ! </td> ! </tr> =head2 Add fields to action configuration ! Finally, while we didn't have to add the field to our SPOPS ! configuration we do have to add it to our actions. (Common action ! configurations don't have an field discovery feature yet.) Add to your ! C<conf/action.ini> under '[book]' these keys and values: c_update_fields = category_id c_add_fields = category_id + After you do so you should be able to add and update your books with + new categories. Give it a whirl! + =head1 ACTIONS: A TEMPLATE CAN BE AN ACTION *************** *** 312,317 **** The only differences are that when we call C<OI.action_execute()> we go through the action's security checks as well as use its cached ! content if available. The C<INCLUDE> call does not -- but it's also ! faster. =head1 ACTIONS: ADDING VALIDATION TO COMMON TASKS --- 324,331 ---- The only differences are that when we call C<OI.action_execute()> we go through the action's security checks as well as use its cached ! content if available. The C<INCLUDE> call does not do this extra work ! so it's a little faster to process. It's up to you whether the speed ! is worth it. (And you can always change between the two, so a decision ! won't be permanent.) =head1 ACTIONS: ADDING VALIDATION TO COMMON TASKS *************** *** 319,324 **** --- 333,530 ---- =head1 ACTIONS: USING MULTIPLE TABLES WITH COMMON SEARCHING + =head2 Another table with searchable information + + Our book empire is growing. We now have multiple locations where our + books are stored and we need to track which books are stored in which + locations. + + For our purposes we'll assume a C<location> table like this: + + CREATE TABLE location ( + location_id %%INCREMENT%%, + name varchar(50) not null, + city varchar(25) null, + state varchar(2) null, + primary key( location_id ) + ) + + And we'll also assume that we're getting a feed of these data from our + shipping company, so we don't need to create code to edit the data. + + For the sake of this exercise we'll also assume we don't need to + manipulate individual 'location' records. Since the search mechanism + relies entirely on database tables and joins we don't require that all + tables are mapped to SPOPS objects. + + Our main reason we want the additional table is for searching -- so we + can find all books in a particular location, or all books with 'Food' + in their title in a particular city. + + =head2 Create a link table + + Since there can be the same book at many different locations, and many + different books at a single location, we have a many-to-many + relationship. For this we need a separate table (aka, 'join table') to + hold the linking data. It'll look like this: + + CREATE TABLE book_at_location ( + book_id %%INCREMENT_TYPE%% not null, + location_id %%INCREMENT_TYPE%% not null, + primary key( book_id, location_id ) + ) + + If you want you can add information specific to this link to the table + (count, date last book received, etc.). For our purposes here it + doesn't matter. + + =head2 Feed the search from your form + + We want to be able to search by location name, city and state. First + we'll add the fields to the search form -- in + C<template/search_form.tmpl> add: + + [% INCLUDE label_form_text_row( label = 'Location', + name = 'loc.name', size = 30 ) %] + + [% INCLUDE label_form_text_row( label = 'City', + name = 'loc.city', size = 30 ) %] + + [% INCLUDE label_form_text_row( label = 'State', + name = 'loc.state', size = 5 ) %] + + Note that we prefixed the field names from our 'location' table + with 'loc.'. That's because we need to need to be able to tell our + action for which fields we should join to another table. + + The string 'loc' doesn't mean anything. It just needs to be consistent + between your form field declarations and the configuration we're about + to do. + + =head2 Configuring the search + + In your C<conf/action.ini> you'll need to add these fields to your + C<c_search_fields*> listings. We'll assume the location name and city + are 'LIKE' matches while the state is an exact match. So under 'book' + add: + + c_search_fields_like = loc.name + c_search_fields_like = loc.city + c_search_fields_exact = loc.state + + Note that we kept the 'loc.' prefix on all fields. + + Next, we need to tell OI2 how to match up our book records with these + 'loc.' fields. We do that with the parameter + C<c_search_table_links>. It will look like this: + + [book c_search_table_links] + loc = book.book_id + loc = book_at_location.book_id + loc = book_at_location.location_id + loc = location.location_id + + The 'loc' field matches our prefix and its values represent (in pairs) + how tables are joined. OI will step through these parameters and + construct a SQL JOIN clause like this: + + WHERE ... + AND book.book_id = book_at_location.book_id + AND book_at_location.location_id = location.location_id + + It will only generate this join if any of the fields with a 'loc' + prefix are searched. So if a user just searches for a book title OI2 + will put together a query like this: + + WHERE book.title LIKE '%Charlotte%' + + But if a user searches for a book title in a particular city this + query will change: + + WHERE book.title LIKE '%Charlotte%' + AND location.city LIKE '%burgh%' + AND book.book_id = book_at_location.book_id + AND book_at_location.location_id = location.location_id + + Once you've made these changes you're ready to search! + =head1 ACTIONS: SECURING AN ACTION + =head2 What is action security? + + There are two layers of security in OpenInteract. The first, action + security, is the most widely used and determines who can do what in + your application. Action security can be segmented by task. So you may + have certain tasks within an action that all users can do (such as + search and view items) but other tasks only users of a particular + group can do (such as create, modify and remove items). + + Security is always specified by group. While the underlying mechanism + for storing and retrieving security can be used with individual users + it's strongly discouraged. + + =head2 Configure your action + + Assigning security to your action is very simple -- all the changes + are in your action's configuration file. + + First, you need to tell OI2 that your action is secure with the + 'is_secure' key: + + [book] + class = OpenInteract2::Action::Book + is_secure = yes + + If this is set to anything but 'yes' the action processor will ignore + any security settings. (In L<OpenInteract2::Manual::Tutorial> we had + this set to 'no'.) + + Now you need to define the security required for your action. You have + three options to choose from: 'NONE', 'READ' and 'WRITE'. (There's a + fourth option, 'SUMMARY', but it's rarely used.) These levels are + additive so if a user has 'WRITE' permission she also has + 'READ'. Also, note that if you don't specify a requirement we assume + 'WRITE'. + + If you want a single security requirement for all tasks in our book + action then the job is easy: + + [book] + class = OpenInteract2::Action::Book + is_secure = yes + security = WRITE + + However, many times you'll want to have separate requirements for + separate tasks. For instance, in our book action we want everyone to + be able to search and display book records. But maybe we only want + groups with WRITE permission to the action to modify the book + records. So we might have: + + [book security] + DEFAULT = WRITE + search = READ + search_form = READ + display = READ + + Here we have a new key, 'DEFAULT'. This is a special task name that + acts as a catch-all: every task not explicitly gets this security. Of + course, since a task not listed gets 'WRITE' security anyway this is + technically redundant. But it better to communicate your intentions + explicitly. + + That's it -- restart the server and your action will now be + secured. Of course, you need to assign security to groups. + + =head2 Assigning security + + Assigning security to actions is typically done through the website -- + click on the 'Security' link from the 'Admin Tools' box, or just go to + the '/security/' URL. + + You can also modify action security through a management task + L<OpenInteract2::Manage::Website::CreateSecurityForAction>, or using + C<oi2_manage>: + + oi2_manage secure_action --action=book --scope=group --scope_id=5 + =head1 SPOPS: ADDING OBJECT BEHAVIORS *************** *** 333,336 **** --- 539,629 ---- =head2 Using Multiple Datasources + OI2 can support multiple datasources. Most applications do not have + need for this, but some may need to present legacy data alongside + current data. + + OI2 ships with a single configured DBI datasource called + 'main'. Assuming a configuration for PostgreSQL it looks like this: + + [datasource main] + type = DBI + dbi_type = Pg + dsn = dbname=current_data + username = pguser + password = pgpass + + Say we have a MySQL database with legacy data. We'd just add it to the + configuration file like this: + + [datasource main] + type = DBI + dbi_type = Pg + dsn = dbname=current_data + username = pguser + password = pgpass + + [datasource legacy] + type = DBI + dbi_type = mysql + dsn = database=legacy + username = mysqluser + password = mysqlpass + + We can reference the datasource in code through the context and use it + as a straight DBI handle: + + my $dbh = CTX->datasource( 'legacy' ); + my $sql = "SELECT count(*) FROM old_table WHERE foo = ?"; + my ( $sth ); + eval { + $sth = $dbh->prepare( $sql ); + $sth->execute( $foo ); + }; + my ( $count ) = $sth->fetchrow_array; + + We can also use the datasource to back our SPOPS objects. Currently, + the easiest way to associate an SPOPS class with a specific datasource + is through its configuration. + + Assuming we had a read-only SPOPS object declaration for old invoices: + + [legacy_invoice] + class = OpenInteract2::LegacyInvoice + isa = SPOPS::Tool::ReadOnly + field = + field_discover = yes + id_field = invoice_id + is_secure = no + base_table = invoice_old + name = invoice_num + object_name = Invoice + + we'd just add a 'datasource' key with the name of our legacy datasource: + + [legacy_invoice] + class = OpenInteract2::LegacyInvoice + isa = SPOPS::Tool::ReadOnly + datasource = legacy + ... + + And that's it. You can use it just like any other SPOPS class: + + my $customer_id = $request->param( 'customer_id' ); + my $invoices = OpenInteract2::LegacyInvoice->fetch_group({ + where => 'customer_id = ?', + value => $customer_id, + order => 'invoice_date DESC' + }); + foreach my $inv ( @{ $invoices } ) { + print "Date: $inv->{invoice_date} ($inv->{num_items})\n"; + } + + SPOPS will pull the data from the separate database, but when you're + accessing the data you won't know (or care) where it's from. + + This means it's also easy to swap datasources behind the scenes -- for + instance, to point to a backup database server if the main one goes + down. + =head1 SEE ALSO |
From: Chris W. <la...@us...> - 2005-03-04 03:00:12
|
Update of /cvsroot/openinteract/OpenInteract2/doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12500/Manual Modified Files: Changes.pod Log Message: latest changes Index: Changes.pod =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/doc/Manual/Changes.pod,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Changes.pod 26 Feb 2005 05:06:57 -0000 1.68 --- Changes.pod 4 Mar 2005 02:59:46 -0000 1.69 *************** *** 183,186 **** --- 183,197 ---- =back + L<OpenInteract2::CreateSecurity> + + =over 4 + + =item * + + OIN-140: Move class from base_security package; modify it to create + action security; add documentation. + + =back + L<OpenInteract2::Manage> *************** *** 213,216 **** --- 224,242 ---- =back + L<OpenInteract2::Manage::Website::CreateSecurity> + + L<OpenInteract2::Manage::Website::CreateSecurityForAction> + + L<OpenInteract2::Manage::Website::CreateSecurityForSPOPS> + + =over 4 + + =item * + + OIN-140: Create a new management task to assign security to an action; + consolidate common security creation code into parent task. + + =back + L<OpenInteract2::Manage::Website::InstallPackageStructure> |
From: Chris W. <la...@us...> - 2005-03-04 02:54:26
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11443 Added Files: CreateSecurity.pm Log Message: OIN-140: move security creation object from base_secure package (it's really a core action) --- NEW FILE: CreateSecurity.pm --- package OpenInteract2::CreateSecurity; # $Id: CreateSecurity.pm,v 1.1 2005/03/04 02:54:18 lachoy Exp $ use strict; use base qw( Class::Accessor::Fast ); use Log::Log4perl qw( get_logger ); use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); use SPOPS::Secure qw( :level :scope ); my @FIELDS = qw( scope scope_id level action spops where iterator website_dir num_processed num_failed start_time end_time elapsed_time ); __PACKAGE__->mk_accessors( @FIELDS ); my %VALID_SCOPE = ( world => SEC_SCOPE_WORLD, user => SEC_SCOPE_USER, group => SEC_SCOPE_GROUP, ); my %VALID_LEVEL = ( none => SEC_LEVEL_NONE, read => SEC_LEVEL_READ, write => SEC_LEVEL_WRITE, ); my %DEFAULTS = ( iterator => 'yes', ); my ( $log ); sub new { my ( $class, $params ) = @_; my $self = bless( {}, $class ); for ( @FIELDS ) { my $value = $params->{ $_ } || $DEFAULTS{ $_ }; $self->$_( $value ) if ( $value ); } return $self; } sub errors { my ( $self ) = @_; $self->{errors} ||= {}; return values %{ $self->{errors} }; } sub errors_with_params { my ( $self ) = @_; $self->{errors} ||= {}; return $self->{errors}; } sub validate { my ( $self ) = @_; unless ( CTX ) { unless ( -d $self->website_dir ) { my $msg = "Parameter 'website_dir' must be set to website dir to " . "create a Context object."; $self->{errors} = { website_dir => $msg }; return 0; } eval { OpenInteract2::Context->create({ website_dir => $self->website_dir }); }; if ( $@ ) { my $msg = "Failed to create Context object: $@"; $self->{errors} = { website_dir => $msg }; return 0; } } my %errors = (); my $scope = lc $self->scope; my $scope_id = $self->scope_id; my $level = lc $self->level; unless ( $scope =~ /^(world|group|user)$/ ) { $errors{scope} = "'scope' must be set to 'world', 'group', or 'user'"; } if ( $scope ne 'world' and ! $scope_id ) { $errors{scope_id} = "'scope_id' must be set if the --scope is set " . "to 'group' or 'user'"; } unless ( $level =~ /^(none|read|write)$/ ) { $errors{level} = "'level' must be set to 'none', 'read' or 'write'"; } if ( my $spops_class = $self->spops ) { if ( ! $spops_class->can( 'fetch' ) ) { $errors{class} = "Class '$spops_class' is not valid. Are you " . "sure it is defined in your OpenInteract setup?"; } elsif ( ! $spops_class->isa( 'SPOPS::Secure' ) ) { $errors{class} = "Class '$spops_class' is not using security."; } } elsif ( my $action_class = $self->action ) { if ( ! UNIVERSAL::isa( $action_class, 'OpenInteract2::Action' ) ) { $errors{class} = "Class '$action_class' does not seem to be a ", "subclass of 'OpenInteract2::Action'."; } } else { $errors{class} = "Class not set, must be set to the class of " . "the object for which you want to set security " . "(e.g., 'OpenInteract2::News')"; } $self->scope( $VALID_SCOPE{ lc $scope } ); $self->level( $VALID_LEVEL{ lc $level } ); $self->{errors} = \%errors; if ( scalar keys %errors == 0 ) { $self->{_validated}++; return 1; } return 0; } sub run { my ( $self ) = @_; $self->start_time( time ); return unless ( $self->{_validated} or $self->validate ); $log ||= get_logger( LOG_OI ); my $scope_id = $self->_resolve_scope_id; my $scope = $self->scope; my $level = $self->level; my ( $count, $failure ) = ( 0, 0 ); if ( my $spops_class = $self->spops ) { my ( $object_store ); if ( $self->iterator eq 'yes' ) { $object_store = $spops_class->fetch_iterator({ skip_security => 1, column_group => '_id_field', where => $self->where, }); } else { $object_store = $spops_class->fetch_group({ skip_security => 1, column_group => '_id_field', where => $self->where, }); } while ( my $object = $self->_get_from_store( $object_store ) ) { my $ok = _create_or_update_security( $scope, $scope_id, $level, $spops_class, $object->id ); $count++; $failure++ unless ( $ok ); } } elsif ( my $action_class = $self->action ) { my $ok = _create_or_update_security( $scope, $scope_id, $level, $action_class, '0', ); $count++; $failure++ unless ( $ok ); } else { # ... die here? this should have already been caught in validate() } $self->num_processed( $count ); $self->num_failed( $failure ); $self->end_time( time ); $self->elapsed_time( $self->end_time - $self->start_time ); return $count; } sub _create_or_update_security { my ( $scope, $scope_id, $level, $class, $object_id ) = @_; my $item = OpenInteract2::Security->fetch_match( undef, { class => $class, object_id => $object_id, scope => $scope, scope_id => $scope_id, }); if ( $item ) { $item->{security_level} = $level; } else { $item = OpenInteract2::Security->new({ class => $class, object_id => $object_id, scope => $scope, scope_id => $scope_id, security_level => $level }); } eval { $item->save() }; if ( $@ ) { $log->info( "FAIL: $object_id ($@)" ); return 0; } else { $log->info( "OK: $object_id" ); return 1; } } # Use either an iterator or a list sub _get_from_store { my ( $self, $store ) = @_; return undef unless ( $store ); if ( ref $store eq 'ARRAY' ) { return undef unless ( scalar @{ $store } ); return shift @{ $store }; } return $store->get_next; } sub _resolve_scope_id { my ( $self ) = @_; my $scope_id = $self->scope_id; my $default_objects = CTX->lookup_default_object_id; if ( $scope_id and $default_objects->{ $scope_id } ) { $scope_id = $default_objects->{ $scope_id }; } return $scope_id; } 1; __END__ =head1 NAME OpenInteract2::CreateSecurity - Batch create security for one or more objects or classes =head1 SYNOPSIS # Create security for an action my $creator = OpenInteract2::CreateSecurity->new({ scope => 'group', scope_id => '5', level => 'write' action => 'myaction', website_dir => '/path/to/mysite', }); unless ( $creator->validate ) { my $errors = $creator->errors_with_params; print "Found errors: \n"; foreach my $param ( keys %{ $errors } ) { print "$param: $errors->{ $param }\n"; } # can also pass the error hashref to the standard exception for # bad parameters: OpenInteract2::Exception::Parameter->throw( "Cannot create security, one or more parameters were invalid", { parameter_fail => $errors } ); } # we're cleared for takeoff $creator->run(); # how'd we do? print "Processed: ", $creator->num_processed, "\n", "Failed: ", $creator->num_failed, "\n", "Elapsed: ", $creator->elapsed_time, " secs\n"; =head1 DESCRIPTION This class can create or update security for a single action class or for a whole group of SPOPS objects. =head1 CLASS METHODS B<new( \%properties )> Create a new object and assign all properties from C<\%properties>. See C<PROPERTIES> for listing. =head1 OBJECT METHODS B<run()> With the C<PROPERTIES> previously set find matching security objects; if found, update them with the new security level, otherwise create new objects. =head1 PROPERTIES B<scope> B<website_dir> B<scope_id> B<level> B<action> B<spops> B<where> B<iterator> B<num_processed> B<num_failed> B<start_time> B<end_time> B<elapsed_time> =head1 SEE ALSO L<OpenInteract2::Manage::Website::CreateSecurity> L<OpenInteract2::Manage::Website::CreateActionSecurity> =head1 COPYRIGHT Copyright (c) 2005 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters E<lt>ch...@cw...E<gt> |
From: Chris W. <la...@us...> - 2005-03-04 02:51:58
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10946/Config Modified Files: Initializer.pm Log Message: allow 'security' to be assigned for all tasks at once Index: Initializer.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config/Initializer.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Initializer.pm 30 Nov 2004 03:12:11 -0000 1.20 --- Initializer.pm 4 Mar 2005 02:51:45 -0000 1.21 *************** *** 347,364 **** my ( $init, $type, $config ) = @_; return unless ( $type eq 'action' ); ! return unless ( ref $config->{security} eq 'HASH' ); $log ||= get_logger( LOG_INIT ); $log->info( "Modifying verbose security for action '$config->{name}'" ); ! foreach my $task ( keys %{ $config->{security} } ) { ! my $task_security = uc $config->{security}{ $task }; ! if ( $task_security =~ /^(NONE|SUMMARY|READ|WRITE)$/i ) { ! $task_security = ! OpenInteract2::Util->verbose_to_level( uc $task_security ); } ! $config->{security}{ $task } = int( $task_security ); } } sub _action_cache_params { --- 347,374 ---- my ( $init, $type, $config ) = @_; return unless ( $type eq 'action' ); ! return unless ( $config->{security} ); $log ||= get_logger( LOG_INIT ); $log->info( "Modifying verbose security for action '$config->{name}'" ); ! ! if ( ref $config->{security} eq 'HASH' ) { ! foreach my $task ( keys %{ $config->{security} } ) { ! my $verbose = uc $config->{security}{ $task }; ! $config->{security}{ $task } = _translate_security_to_level( $verbose ); } ! } ! else { ! my $verbose = uc $config->{security}; ! $config->{security} = _translate_security_to_level( $verbose ); } } + sub _translate_security_to_level { + my ( $verbose ) = @_; + if ( $verbose =~ /^(NONE|SUMMARY|READ|WRITE)$/i ) { + $verbose = OpenInteract2::Util->verbose_to_level( uc $task_security ); + } + return int( $verbose ); + } sub _action_cache_params { *************** *** 668,672 **** In the action configuration you can use verbose descriptions of security levels like 'READ' and 'WRITE'. These get translated to the ! codes exported by L<SPOPS::Secure|SPOPS::Secure>. =item B<Caching Parameters> --- 678,683 ---- In the action configuration you can use verbose descriptions of security levels like 'READ' and 'WRITE'. These get translated to the ! codes exported by L<SPOPS::Secure|SPOPS::Secure> via the ! C<verbose_to_level()> method in L<OpenInteract2::Util>. =item B<Caching Parameters> |
From: Chris W. <la...@us...> - 2005-03-04 02:51:57
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10946 Modified Files: Action.pm Log Message: allow 'security' to be assigned for all tasks at once Index: Action.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action.pm,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Action.pm 2 Mar 2005 15:32:23 -0000 1.70 --- Action.pm 4 Mar 2005 02:51:44 -0000 1.71 *************** *** 50,54 **** security_level => 'Security level found for this action + task invocation', security_required => 'Security level required for this action + task invocation', ! security => 'Whether to use security (yes/no)', url_alt => 'Alternate URLs that can be used to lookup this action', url_none => 'Flag to indicate that this action cannot be looked up by URL (yes/no)', --- 50,54 ---- security_level => 'Security level found for this action + task invocation', security_required => 'Security level required for this action + task invocation', ! security => 'Configured security levels', url_alt => 'Alternate URLs that can be used to lookup this action', url_none => 'Flag to indicate that this action cannot be looked up by URL (yes/no)', *************** *** 481,500 **** my $action_security = $self->security; ! unless ( ref $action_security eq 'HASH' ) { $log->error( "Secure action, no security configuration" ); oi_error "Configuration error: action is secured but no ", "security requirements configured"; } my $task = $self->task; ! my $required_level = $action_security->{ $task } || ! $action_security->{DEFAULT} || ! $action_security->{default}; unless ( defined $required_level ) { $log->is_info && $log->info( "Assigned security level WRITE to task ", ! "'$task' since security requirement not found" ); $required_level = SEC_LEVEL_WRITE; } --- 481,512 ---- my $action_security = $self->security; ! unless ( $action_security ) { $log->error( "Secure action, no security configuration" ); oi_error "Configuration error: action is secured but no ", "security requirements configured"; } + my ( $required_level ); + + # NOTE: values in $action_security have already been translated to + # security levels by OI2::Config::Initializer::_action_security_level() + # at server startup. + # specify security per task... my $task = $self->task; ! if ( ref $action_security eq 'HASH' ) { ! $required_level = $action_security->{ $task } || ! $action_security->{DEFAULT} || ! $action_security->{default}; ! } + # specify security for entire action... + else { + $required_level = $action_security; + } unless ( defined $required_level ) { $log->is_info && $log->info( "Assigned security level WRITE to task ", ! "'$task' since no security requirement found" ); $required_level = SEC_LEVEL_WRITE; } *************** *** 506,511 **** my $msg = sprintf( "Security check for '%s' '%s' failed", $self->name, $task ); ! $log->error( "$msg [required: $required_level] ", ! "[found: $action_level]" ); oi_security_error $msg, { security_required => $required_level, --- 518,523 ---- my $msg = sprintf( "Security check for '%s' '%s' failed", $self->name, $task ); ! $log->warn( "$msg [required: $required_level] ", ! "[found: $action_level]" ); oi_security_error $msg, { security_required => $required_level, |
From: Chris W. <la...@us...> - 2005-03-04 02:50:13
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10564/Manage/Website Modified Files: CreateSecurity.pm Added Files: CreateSecurityForAction.pm CreateSecurityForSPOPS.pm Log Message: OIN-140: add new management task for creating action security, and move common security creation code into parent class for the SPOPS and action tasks --- NEW FILE: CreateSecurityForAction.pm --- package OpenInteract2::Manage::Website::CreateSecurityForAction; # $Id: CreateSecurityForAction.pm,v 1.1 2005/03/04 02:50:01 lachoy Exp $ use strict; use base qw( OpenInteract2::Manage::Website::CreateSecurity ); $OpenInteract2::Manage::Website::CreateSecurityForAction::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); sub get_name { return 'secure_action'; } sub get_brief_description { return "Assign security settings for an OI2 action."; } sub get_parameters { my ( $self ) = @_; my $params = $self->SUPER::get_parameters(); $params->{action} = { description => "Action name for which you'd like to set security", is_required => 'yes', }; return $params; } sub _assign_create_params { my ( $self, $creator ) = @_; $creator->action( $self->param( 'action' ) ); } OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); 1; __END__ =head1 NAME OpenInteract2::Manage::Website::CreateSecurityForAction - Create security for an OI2 action =head1 SYNOPSIS #!/usr/bin/perl use strict; use OpenInteract2::Manage; my $website_dir = '/home/httpd/mysite'; my %PARAMS = ( scope => 'group', scope_id => 4, action => 'news', level => 'write', website_dir => $website_dir, ); my $task = OpenInteract2::Manage->new( 'secure_action', \%PARAMS ); my @status = $task->execute; foreach my $s ( @status ) { my $ok_label = ( $s->{is_ok} eq 'yes' ) ? 'OK' : 'NOT OK'; print "Status OK? $s->{is_ok}\n", "$s->{message}\n"; } =head1 REQUIRED OPTIONS =over 4 =item B<scope>=(user|group|world) Scope of security you're setting =item B<scope_id>=ID of 'scope' Scope ID of security you're setting. Not used with 'world' scope. =item B<action>=action-name The name of the action class to which you're adding/modifying security. For instance, 'news' if you're trying to set security to the 'OpenInteract2::Action::News' class. For a list of actions see L<OpenInteract2::Manage::Website::ListActions>, or just run C<oi2_manage list_actions>. =back =head1 STATUS INFORMATION Each status hashref includes: =over 4 =item B<is_ok> Set to 'yes' if the task succeeded, 'no' if not. =item B<message> Success/failure message. =back =head1 SEE ALSO L<OpenInteract2::Manage::Website::CreateSecurity> L<OpenInteract2::CreateSecurity> =head1 COPYRIGHT Copyright (C) 2003-2004 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters E<lt>ch...@cw...E<gt> --- NEW FILE: CreateSecurityForSPOPS.pm --- package OpenInteract2::Manage::Website::CreateSecurityForSPOPS; # $Id: CreateSecurityForSPOPS.pm,v 1.1 2005/03/04 02:50:01 lachoy Exp $ use strict; use base qw( OpenInteract2::Manage::Website::CreateSecurity ); $OpenInteract2::Manage::Website::CreateSecurityForSPOPS::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); # METADATA sub get_name { return 'secure_spops'; } sub get_brief_description { return "Create security settings for multiple SPOPS objects at once."; } sub get_parameters { my ( $self ) = @_; my $params = $self->SUPER::get_parameters(); $params->{spops} = { description => "SPOPS object tag for class you'd like to set security", is_required => 'yes', }; $params->{where} = { description => "A 'where' clause to restrict the objects for which you'll set security", is_required => 'no', }; return $params; } sub _assign_create_params { my ( $self, $creator ) = @_; $creator->spops( $self->param( 'spops' ) ); $creator->where( $self->param( 'where' ) ); } OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); 1; __END__ =head1 NAME OpenInteract2::Manage::Website::CreateSecurityForSPOPS - Create security for multiple SPOPS objects =head1 SYNOPSIS #!/usr/bin/perl use strict; use OpenInteract2::Manage; my $website_dir = '/home/httpd/mysite'; my %PARAMS = ( scope => 'group', scope_id => 4, spops => 'news', level => 'read', website_dir => $website_dir, ); my $task = OpenInteract2::Manage->new( 'secure_spops', \%PARAMS ); my @status = $task->execute; foreach my $s ( @status ) { my $ok_label = ( $s->{is_ok} eq 'yes' ) ? 'OK' : 'NOT OK'; print "Status OK? $s->{is_ok}\n", "$s->{message}\n"; } =head1 REQUIRED OPTIONS =over 4 =item B<scope>=(user|group|world) Scope of security you're setting =item B<scope_id>=ID of 'scope' Scope ID of security you're setting. Ignored with 'world' scope. =item B<spops>=object-key The key used for the SPOPS objects you're trying to add security to. For instance you'd use 'news' if you're trying to add security to 'OpenInteract2::News' objects. =item B<where>=WHERE-clause If you want to restrict the objects you assign security to pass in a WHERE clause. For instance, if you want to only set security for objects created this year: oi2_manage create_spops_security ... --where "posted_on >= '2005-01-01'" =back =head1 STATUS INFORMATION Each status hashref includes: =over 4 =item B<is_ok> Set to 'yes' if the task succeeded, 'no' if not. =item B<message> Success/failure message. =back =head1 SEE ALSO L<OpenInteract2::CreateSecurity|OpenInteract2::CreateSecurity> =head1 COPYRIGHT Copyright (C) 2003-2004 Chris Winters. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS Chris Winters E<lt>ch...@cw...E<gt> Index: CreateSecurity.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/CreateSecurity.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CreateSecurity.pm 13 Jun 2004 18:19:54 -0000 1.4 --- CreateSecurity.pm 4 Mar 2005 02:50:01 -0000 1.5 *************** *** 12,25 **** $OpenInteract2::Manage::Website::CreateSecurity::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); - # METADATA - - sub get_name { - return 'create_security'; - } - - sub get_brief_description { - return "Create security settings for multiple SPOPS objects at once."; - } - sub get_parameters { my ( $self ) = @_; --- 12,15 ---- *************** *** 41,49 **** is_required => 'yes', }, - spops => { - description => - "SPOPS object tag for class you'd like to set security", - is_required => 'yes', - } }; } --- 31,34 ---- *************** *** 60,75 **** $self->_setup_context; my $creator = OpenInteract2::CreateSecurity->new({ ! scope => $self->param( 'scope' ), ! scope_id => $self->param( 'scope_id' ), ! level => $self->param( 'level' ), ! class => $self->param( 'spops' ), ! website_dir => $self->param( 'website_dir' ), }); unless ( $creator->validate ) { my $errors = $creator->errors_with_params; - if ( $errors->{class} ) { - $errors->{spops} = $errors->{class}; - delete $errors->{class}; - } oi_param_error "One or more parameters were invalid", { parameter_fail => $errors }; --- 45,56 ---- $self->_setup_context; my $creator = OpenInteract2::CreateSecurity->new({ ! scope => $self->param( 'scope' ), ! scope_id => $self->param( 'scope_id' ), ! level => $self->param( 'level' ), ! website_dir => $self->param( 'website_dir' ), }); + $self->_assign_create_params( $creator ); unless ( $creator->validate ) { my $errors = $creator->errors_with_params; oi_param_error "One or more parameters were invalid", { parameter_fail => $errors }; *************** *** 78,81 **** --- 59,67 ---- } + sub _assign_create_params { + my ( $self ) = @_; + oi_error ref( $self ), " must implement '_assign_create_params()'"; + } + # RUN *************** *** 88,92 **** my ( $self ) = @_; my $creator = $self->param( 'creator' ); ! my $count = $creator->run; my $msg = join( '', "Processed ", $creator->num_processed, " and ", "encountered ", $creator->num_failed, " failures. " ); --- 74,78 ---- my ( $self ) = @_; my $creator = $self->param( 'creator' ); ! $creator->run; my $msg = join( '', "Processed ", $creator->num_processed, " and ", "encountered ", $creator->num_failed, " failures. " ); *************** *** 94,99 **** } - OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); - 1; --- 80,83 ---- *************** *** 113,120 **** my $website_dir = '/home/httpd/mysite'; my %PARAMS = ( ! scope => 4, ! scope_id => 4, ! spops => 'news', ! level => 'read', website_dir => $website_dir, ); --- 97,104 ---- my $website_dir = '/home/httpd/mysite'; my %PARAMS = ( ! scope => 'group', ! scope_id => 4, ! spops => 'news', ! level => 'read', website_dir => $website_dir, ); *************** *** 138,142 **** =item B<scope_id>=ID of 'scope' ! Scope ID of security you're setting. Not used with 'world' scope. =item B<spops>=object-key --- 122,126 ---- =item B<scope_id>=ID of 'scope' ! Scope ID of security you're setting. Ignored with 'world' scope. =item B<spops>=object-key *************** *** 166,171 **** =head1 SEE ALSO ! L<OpenInteract2::CreateSecurity|OpenInteract2::CreateSecurity> (in ! 'base_security' package) =head1 COPYRIGHT --- 150,154 ---- =head1 SEE ALSO ! L<OpenInteract2::CreateSecurity|OpenInteract2::CreateSecurity> =head1 COPYRIGHT |
From: Chris W. <la...@us...> - 2005-03-03 15:33:56
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14829/t Modified Files: utils.pl Log Message: update base security version Index: utils.pl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/utils.pl,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** utils.pl 3 Mar 2005 13:12:13 -0000 1.98 --- utils.pl 3 Mar 2005 15:33:31 -0000 1.99 *************** *** 50,54 **** base_group => '2.19', base_page => '2.30', ! base_security => '2.20', base_template => '3.17', base_theme => '2.13', --- 50,54 ---- base_group => '2.19', base_page => '2.30', ! base_security => '2.21', base_template => '3.17', base_theme => '2.13', |
From: Chris W. <la...@us...> - 2005-03-03 15:19:03
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9554/base_security Modified Files: Changes MANIFEST package.ini Log Message: move OI2::CreateSecurity up to main dist Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_security/Changes,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Changes 1 Mar 2005 03:28:37 -0000 1.20 --- Changes 3 Mar 2005 15:18:32 -0000 1.21 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_security. + 2.21 Thu Mar 3 10:10:31 EST 2005 + + Move OI2::CreateSecurity to main distribution + 2.20 Mon Feb 28 20:33:57 EST 2005 Index: MANIFEST =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_security/MANIFEST,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MANIFEST 1 Mar 2005 03:28:37 -0000 1.7 --- MANIFEST 3 Mar 2005 15:18:33 -0000 1.8 *************** *** 7,11 **** data/install_security.dat msg/base_security-messages-en.msg - OpenInteract2/CreateSecurity.pm OpenInteract2/Action/Security.pm OpenInteract2/App/BaseSecurity.pm --- 7,10 ---- Index: package.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_security/package.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** package.ini 1 Mar 2005 03:28:37 -0000 1.2 --- package.ini 3 Mar 2005 15:18:33 -0000 1.3 *************** *** 1,5 **** [package] name = base_security ! version = 2.20 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ --- 1,5 ---- [package] name = base_security ! version = 2.21 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ *************** *** 11,14 **** as to set security on individual objects. Includes templates that \ list the various modules and that allow you (as the admin) to set ! security for various tasks. Also includes the component(s) for \ ! security on a object-level basis. --- 11,13 ---- as to set security on individual objects. Includes templates that \ list the various modules and that allow you (as the admin) to set ! security for various tasks. |
From: Chris W. <la...@us...> - 2005-03-03 15:18:43
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_security/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9554/base_security/OpenInteract2 Removed Files: CreateSecurity.pm Log Message: move OI2::CreateSecurity up to main dist --- CreateSecurity.pm DELETED --- |
From: Chris W. <la...@us...> - 2005-03-03 13:12:30
|
Update of /cvsroot/openinteract/OpenInteract2/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6486/t Modified Files: utils.pl Log Message: update module versions Index: utils.pl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/t/utils.pl,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** utils.pl 2 Mar 2005 15:42:13 -0000 1.97 --- utils.pl 3 Mar 2005 13:12:13 -0000 1.98 *************** *** 48,58 **** base_box => '2.19', base_error => '3.02', ! base_group => '2.18', base_page => '2.30', base_security => '2.20', base_template => '3.17', ! base_theme => '2.12', ! base_user => '2.39', ! comments => '1.21', full_text => '2.61', lookup => '2.09', --- 48,58 ---- base_box => '2.19', base_error => '3.02', ! base_group => '2.19', base_page => '2.30', base_security => '2.20', base_template => '3.17', ! base_theme => '2.13', ! base_user => '2.40', ! comments => '1.22', full_text => '2.61', lookup => '2.09', |
From: Chris W. <la...@us...> - 2005-03-03 13:11:11
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_group In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6100/base_group Modified Files: package.ini Changes Log Message: start adding REST parameter directives where appropriate Index: package.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_group/package.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** package.ini 1 Mar 2005 03:28:35 -0000 1.2 --- package.ini 3 Mar 2005 13:10:57 -0000 1.3 *************** *** 1,5 **** [package] name = base_group ! version = 2.18 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ --- 1,5 ---- [package] name = base_group ! version = 2.19 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_group/Changes,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Changes 1 Mar 2005 03:28:34 -0000 1.19 --- Changes 3 Mar 2005 13:10:57 -0000 1.20 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_group. + 2.19 Wed Mar 2 22:46:28 EST 2005 + + Add 'group_id' as extra URL param. + 2.18 Mon Feb 28 20:33:57 EST 2005 |
From: Chris W. <la...@us...> - 2005-03-03 13:11:09
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_theme In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6100/base_theme Modified Files: package.ini Changes Log Message: start adding REST parameter directives where appropriate Index: package.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_theme/package.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** package.ini 1 Mar 2005 03:28:39 -0000 1.2 --- package.ini 3 Mar 2005 13:10:57 -0000 1.3 *************** *** 1,5 **** [package] name = base_theme ! version = 2.12 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ --- 1,5 ---- [package] name = base_theme ! version = 2.13 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_theme/Changes,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Changes 1 Mar 2005 03:28:39 -0000 1.13 --- Changes 3 Mar 2005 13:10:57 -0000 1.14 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_theme. + 2.13 Wed Mar 2 22:46:28 EST 2005 + + Add 'theme_id' as extra URL param. + 2.12 Mon Feb 28 20:33:57 EST 2005 |
From: Chris W. <la...@us...> - 2005-03-03 13:11:09
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6100/base_user Modified Files: package.ini Changes Log Message: start adding REST parameter directives where appropriate Index: package.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/package.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** package.ini 1 Mar 2005 03:28:40 -0000 1.2 --- package.ini 3 Mar 2005 13:10:57 -0000 1.3 *************** *** 1,5 **** [package] name = base_user ! version = 2.39 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ --- 1,5 ---- [package] name = base_user ! version = 2.40 author = Chris Winters (ch...@cw...) url = http://www.openinteract.org/ Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/Changes,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Changes 1 Mar 2005 03:28:40 -0000 1.40 --- Changes 3 Mar 2005 13:10:57 -0000 1.41 *************** *** 1,4 **** --- 1,8 ---- Revision history for OpenInteract package base_user. + 2.40 Wed Mar 2 22:46:28 EST 2005 + + Add 'user_id' as extra URL param. + 2.39 Mon Feb 28 20:33:57 EST 2005 |
From: Chris W. <la...@us...> - 2005-03-03 13:11:07
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_group/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6100/base_group/conf Modified Files: action.ini Log Message: start adding REST parameter directives where appropriate Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_group/conf/action.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** action.ini 13 Jun 2004 19:42:00 -0000 1.6 --- action.ini 3 Mar 2005 13:10:57 -0000 1.7 *************** *** 3,6 **** --- 3,7 ---- is_secure = yes task_default = list + url_additional = group_id c_object_type = group c_display_add_template = base_group::group_form |
From: Chris W. <la...@us...> - 2005-03-03 13:11:07
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_user/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6100/base_user/conf Modified Files: action.ini Log Message: start adding REST parameter directives where appropriate Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_user/conf/action.ini,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** action.ini 1 Dec 2004 05:16:54 -0000 1.10 --- action.ini 3 Mar 2005 13:10:56 -0000 1.11 *************** *** 3,6 **** --- 3,7 ---- is_secure = no task_default = search_form + url_additional = user_id c_object_type = user c_display_template = base_user::user_detail |
From: Chris W. <la...@us...> - 2005-03-03 13:11:07
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_theme/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6100/base_theme/conf Modified Files: action.ini Log Message: start adding REST parameter directives where appropriate Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_theme/conf/action.ini,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** action.ini 6 Jun 2003 05:20:57 -0000 1.4 --- action.ini 3 Mar 2005 13:10:57 -0000 1.5 *************** *** 3,6 **** --- 3,7 ---- is_secure = yes task_default = list + url_additional = theme_id max_temp = 10 c_object_type = theme |
From: Chris W. <la...@us...> - 2005-03-03 13:09:43
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5605 Modified Files: package.ini Changes Log Message: OIN-112: metadata Index: package.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/package.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** package.ini 1 Mar 2005 03:28:41 -0000 1.2 --- package.ini 3 Mar 2005 13:09:12 -0000 1.3 *************** *** 1,5 **** [package] name = comments ! version = 1.21 author = Chris Winters <ch...@cw...> url = http://www.cwinters.com/ --- 1,5 ---- [package] name = comments ! version = 1.22 author = Chris Winters <ch...@cw...> url = http://www.cwinters.com/ Index: Changes =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/Changes,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Changes 1 Mar 2005 03:28:41 -0000 1.19 --- Changes 3 Mar 2005 13:09:12 -0000 1.20 *************** *** 1,4 **** --- 1,12 ---- Revision history for OpenInteract package comments. + 1.22 Wed Mar 2 23:47:36 EST 2005 + + OIN-112: change the 'email on new thread?' a dropdown and modify + the language for the labels based on whether you're already + subscribed; deciding to unsubscribe from the thread will remove + your notification; unchecking the 'Remember me?' will now axe + the cookie. + 1.21 Mon Feb 28 20:33:57 EST 2005 |
From: Chris W. <la...@us...> - 2005-03-03 13:09:24
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5517/OpenInteract2/Action Modified Files: Comments.pm Log Message: OIN-112: allow users to unsubscribe themselves from a thread; remove the 'remember me?' cookie if they don't select it Index: Comments.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/OpenInteract2/Action/Comments.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Comments.pm 28 Feb 2005 01:56:12 -0000 1.13 --- Comments.pm 3 Mar 2005 13:08:57 -0000 1.14 *************** *** 18,21 **** --- 18,22 ---- my $DEFAULT_ECODE_LINE_LENGTH = 70; + my $DELIMITER = ':::'; # Display some summary info (plus a link) for an object *************** *** 237,243 **** # This is internal-only: reads ! # form_settings ! # comment ! # pre_escaped sub _show_editable { --- 238,244 ---- # This is internal-only: reads ! # form_settings (\%) ! # comment (object) ! # pre_escaped ($) sub _show_editable { *************** *** 245,252 **** $log ||= get_logger( LOG_APP ); ! my $form_settings => $self->param( 'form_settings' ); ! my $comment = $self->param( 'comment' ); ! ! my %params = ( form_settings => $form_settings ); --- 246,251 ---- $log ||= get_logger( LOG_APP ); ! my $comment = $self->param( 'comment' ); ! my %params = (); *************** *** 268,273 **** } ! $params{comment} = $comment; ! $params{object} = $self->_fetch_object_for_comment( $comment ); return $self->generate_content( \%params, { name => 'comments::comment_form_page' } ); --- 267,281 ---- } ! $params{comment} = $comment; ! $params{object} = $self->_fetch_object_for_comment( $comment ); ! ! my $remember_poster = $self->param( 'remember_poster' ); ! $params{remember_poster} = ! $remember_poster || ( $self->_has_cookie() ) ? 'yes' : ''; ! ! my $is_subscribed = $self->param( 'is_subscribed' ); ! $params{is_subscribed} = ! $is_subscribed || ( $self->_is_subscribed( $comment ) ) ? 'yes' : 'no'; ! return $self->generate_content( \%params, { name => 'comments::comment_form_page' } ); *************** *** 293,311 **** sub show_empty_form { my ( $self ) = @_; ! my %params = ( comment => $self->_fill_in_default_comment ); return $self->generate_content( \%params, { name => 'comments::comment_form' } ); } sub _fill_in_default_comment { my ( $self ) = @_; my $comment = OpenInteract2::Comment->new(); ! my $cookie_name = $self->param( 'cookie_name' ) || 'comment_info'; ! my $poster_info = CTX->request->cookie( $cookie_name ); if ( $poster_info ) { ! ( $comment->{poster_name}, ! $comment->{poster_url}, ! $comment->{poster_email} ) = split ':::', $poster_info; } my $object = $self->param( 'object' ); if ( $object ) { --- 301,346 ---- sub show_empty_form { my ( $self ) = @_; ! my $comment = $self->_fill_in_default_comment(); ! my $has_cookie = $self->_has_cookie(); ! my $is_subscribed = ( $has_cookie ) ! ? $self->_is_subscribed( $comment ) : 0; ! my %params = ( ! comment => $comment, ! remember_poster => $has_cookie ? 'yes' : '', ! is_subscribed => $is_subscribed ? 'yes' : 'no', ! ); return $self->generate_content( \%params, { name => 'comments::comment_form' } ); } + sub _is_subscribed { + my ( $self, $comment ) = @_; + my ( $c_class, $c_id ) = ( $comment->{class}, $comment->{object_id} ); + return 0 unless ( $c_class and $c_id ); + my $poster_info = $self->_get_info_from_cookie(); + return 0 unless ( $poster_info->{email} ); + my $items = OpenInteract2::CommentNotify->fetch_group({ + where => 'class = ? AND object_id = ? AND email = ?', + value => [ $c_class, $c_id, lc $poster_info->{email} ] + }); + return ( ref $items and scalar @{ $items } ); + } + + sub _has_cookie { + my ( $self ) = @_; + my $poster_info = $self->_get_info_from_cookie; + return ( $poster_info ) ? 1 : 0; + } + sub _fill_in_default_comment { my ( $self ) = @_; my $comment = OpenInteract2::Comment->new(); ! my $poster_info = $self->_get_info_from_cookie; if ( $poster_info ) { ! $comment->{poster_name} = $poster_info->{name}; ! $comment->{poster_url} = $poster_info->{url}; ! $comment->{poster_email} = $poster_info->{email}; } + my $object = $self->param( 'object' ); if ( $object ) { *************** *** 314,318 **** } else { ! $comment->{class} = $self->param( 'class' ); $comment->{object_id} = $self->param( 'object_id' ); } --- 349,353 ---- } else { ! $comment->{class} = $self->param( 'class' ); $comment->{object_id} = $self->param( 'object_id' ); } *************** *** 320,323 **** --- 355,391 ---- } + sub _get_cookie_name { + my ( $self ) = @_; + return $self->param( 'cookie_name' ) || + $self->param( 'default_cookie_name' ) || + 'comment_info'; + } + + sub _get_info_from_cookie { + my ( $self ) = @_; + my $cookie_name = $self->_get_cookie_name(); + my $poster_info = CTX->request->cookie( $cookie_name ); + return unless ( $poster_info ); + my ( $name, $url, $email ) = split $DELIMITER, $poster_info; + return { name => $name, url => $url, email => $email }; + } + + sub _store_cookie { + my ( $self, $name, $url, $email ) = @_; + my $cookie_info = join( $DELIMITER, $name, $url, $email ); + OpenInteract2::Cookie->create({ + name => $self->_get_cookie_name(), + value => $cookie_info, + expires => '+6M', + HEADER => 'yes', + }); + } + + sub _remove_cookie { + my ( $self ) = @_; + OpenInteract2::Cookie->expire( $self->_get_cookie_name() ); + } + + sub add { my ( $self ) = @_; *************** *** 396,403 **** # Non-object form widgets ! my %form_settings = ( ! remember_poster => scalar( $request->param( 'remember_poster' ) ), ! comment_notify => scalar( $request->param( 'comment_notify' ) ) ! ); my %required = ( --- 464,471 ---- # Non-object form widgets ! $self->param( remember_poster => scalar( $request->param( 'remember_poster' ) ) ); ! $self->param( is_subscribed => scalar( $request->param( 'is_subscribed' ) ) ); ! ! # check requirements my %required = ( *************** *** 411,416 **** } ! $self->param( comment => $comment ); ! $self->param( form_settings => \%form_settings ); if ( scalar @required_missing ) { --- 479,483 ---- } ! $self->param( comment => $comment ); if ( scalar @required_missing ) { *************** *** 435,452 **** my $remember = $request->param( 'remember_poster' ); if ( $remember eq 'yes' ) { ! my $cookie_info = join( ':::', $comment->{poster_name}, ! $comment->{poster_url}, ! $comment->{poster_email} ); ! my $cookie_name = $self->param( 'cookie_name' ) || ! $self->param( 'default_cookie_name' ) || ! 'comment_info'; ! OpenInteract2::Cookie->create({ ! name => $cookie_name, ! value => $cookie_info, ! expires => '+6M', ! HEADER => 'yes', ! }); ! $log->is_info && ! $log->info( "Created 'remember' cookie with '$cookie_info'" ); } --- 502,512 ---- my $remember = $request->param( 'remember_poster' ); if ( $remember eq 'yes' ) { ! $self->_store_cookie( $comment->{poster_name}, ! $comment->{poster_url}, ! $comment->{poster_email} ); ! $log->is_info && $log->info( "Created 'remember' cookie" ); ! } ! else { ! $self->_remove_cookie(); } *************** *** 468,477 **** $self->_add_auto_notifications( $comment ); $self->_process_notifications( $comment ); ! my $notify_status = $self->_add_user_notification( $comment ); ! if ( $notify_status ) { ! $self->add_status( $notify_status ); ! } } - return $self->list_by_object; } --- 528,533 ---- $self->_add_auto_notifications( $comment ); $self->_process_notifications( $comment ); ! $self->_check_user_notification( $comment ); } return $self->list_by_object; } *************** *** 554,567 **** # further posts. Return value is the status they see. ! sub _add_user_notification { my ( $self, $comment ) = @_; $log ||= get_logger( LOG_APP ); my $request = CTX->request; ! my $user_notify = $request->param( 'comment_notify' ); ! unless ( $user_notify eq 'yes' ) { ! $log->is_info && ! $log->info( "User has elected not to be notified of new ", ! "messages in thread" ); return; } --- 610,630 ---- # further posts. Return value is the status they see. ! sub _check_user_notification { my ( $self, $comment ) = @_; $log ||= get_logger( LOG_APP ); my $request = CTX->request; ! my $is_subscribed = $self->_is_subscribed( $comment ); ! my $user_sub_option = $request->param( 'is_subscribed' ); ! ! if ( $is_subscribed and $user_sub_option eq 'yes' ) { ! $log->is_debug && ! $log->debug( "User subscribes and wants to keep notification" ); ! return; ! } ! elsif ( ! $is_subscribed and $user_sub_option eq 'no' ) { ! $log->is_debug && ! $log->debug( "User is not subscriber and has elected not ", ! "to be notified of new messages in thread" ); return; } *************** *** 570,574 **** # return an error message ! unless ( $comment->{poster_email} ) { $log->is_info && $log->info( "Posted wants to be notified but didn't ", --- 633,638 ---- # return an error message ! my $email = $comment->{poster_email}; ! unless ( $email ) { $log->is_info && $log->info( "Posted wants to be notified but didn't ", *************** *** 578,587 **** } ! unless ( $comment->{poster_email} =~ /$Mail::Sendmail::address_rx/ ) { $log->is_info && $log->info( "Posted wants to be notified but provided a bad ", ! "email address: '$comment->{poster_email}'" ); ! $self->add_error_key( 'comments.error.cannot_add_notify_bad_email', ! $comment->{poster_email} ); return; } --- 642,651 ---- } ! unless ( $email =~ /$Mail::Sendmail::address_rx/ ) { $log->is_info && $log->info( "Posted wants to be notified but provided a bad ", ! "email address: '$email'" ); ! $self->add_error_key( ! 'comments.error.cannot_add_notify_bad_email', $email ); return; } *************** *** 590,629 **** # is already registered ! my $notes = eval { OpenInteract2::CommentNotify->fetch_group({ ! where => 'class = ? AND object_id = ?', ! value => [ $comment->{class}, $comment->{object_id} ], }) }; if ( $@ ) { $log->error( "Error fetching notifications for: ", ! "'$comment->{class}: $comment->{object_id}': $@" ); $self->add_error_key( 'comments.error.cannot_add_notify_error_dupe_check' ); ! return } ! my %existing_mail = map { lc $_->{email} => 1 } @{ $notes }; ! if ( $existing_mail{ lc $comment->{poster_email} } ) { ! $log->is_info && ! $log->info( "No notification added: already exists in thread" ); $self->add_error_key( 'comments.error.cannot_add_notify_is_dupe' ); - return; } ! eval { ! OpenInteract2::CommentNotify->new({ ! class => $comment->{class}, ! object_id => $comment->{object_id}, ! name => $comment->{poster_name}, ! email => lc $comment->{poster_email} ! })->save() ! }; ! if ( $@ ) { ! $log->error( "Failed to save notification: $@" ); ! $self->add_error_key( 'comments.error.cannot_add_notify_persist', "$@" ); ! return; } - $self->add_status_key( 'comments.status.add_notify_ok' ); - return; } --- 654,707 ---- # is already registered ! my $notifications = eval { OpenInteract2::CommentNotify->fetch_group({ ! where => 'class = ? AND object_id = ? AND email = ?', ! value => [ $comment->{class}, $comment->{object_id}, lc $email ], }) }; if ( $@ ) { $log->error( "Error fetching notifications for: ", ! "$comment->{class}; $comment->{object_id}; $email: $@" ); $self->add_error_key( 'comments.error.cannot_add_notify_error_dupe_check' ); ! return; } + my $existing_notifications = + ( ref $notifications eq 'ARRAY' and scalar @{ $notifications } ); ! if ( $is_subscribed and $existing_notifications ) { ! my $notify = $notifications->[0]; ! eval { $notify->remove }; ! if ( $@ ) { ! $log->error( "Cannot remove notification: $@" ); ! $self->add_error_key( 'comments.error.cannot_remove_notify' ); ! } ! else { ! $self->add_status_key( 'comments.status.remove_notify_ok' ); ! } ! } ! ! elsif ( $existing_notifications ) { ! $log->is_debug && ! $log->debug( "No notification added: already exists in thread" ); $self->add_error_key( 'comments.error.cannot_add_notify_is_dupe' ); } ! else { ! eval { ! OpenInteract2::CommentNotify->new({ ! class => $comment->{class}, ! object_id => $comment->{object_id}, ! name => $comment->{poster_name}, ! email => lc $comment->{poster_email} ! })->save() ! }; ! if ( $@ ) { ! $log->error( "Failed to save notification: $@" ); ! $self->add_error_key( 'comments.error.cannot_add_notify_persist', "$@" ); ! } ! else { ! $self->add_status_key( 'comments.status.add_notify_ok' ); ! } } } |
From: Chris W. <la...@us...> - 2005-03-03 13:07:50
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5194 Modified Files: comments-messages-en.msg Log Message: shorten the formatting message (was expanding table) Index: comments-messages-en.msg =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/msg/comments-messages-en.msg,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** comments-messages-en.msg 3 Mar 2005 13:03:48 -0000 1.8 --- comments-messages-en.msg 3 Mar 2005 13:07:38 -0000 1.9 *************** *** 4,8 **** comments.no_comments = No comments to display. comments.form.title = Post a comment ! comments.form.no_html = (No HTML allowed; use '<ecode></ecode>' around preformatted text; http:// links automagically created.) comments.form.remember = Remember info? comments.form.notify = Email on new thread posts? --- 4,8 ---- comments.no_comments = No comments to display. comments.form.title = Post a comment ! comments.form.no_html = (No HTML; '<ecode></ecode>' preformats; http:// autocreates links.) comments.form.remember = Remember info? comments.form.notify = Email on new thread posts? |
From: Chris W. <la...@us...> - 2005-03-03 13:04:55
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4457/template Modified Files: comment_form.tmpl Log Message: OIN-112: change the subscribe/unsubscribe to a dropdown with choices that reflect whether you're currently subscribed Index: comment_form.tmpl =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/template/comment_form.tmpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** comment_form.tmpl 17 May 2004 14:21:53 -0000 1.3 --- comment_form.tmpl 3 Mar 2005 13:04:38 -0000 1.4 *************** *** 61,65 **** <tr [% PROCESS row_color %]> <td colspan="2" align="center"> ! [% MSG( 'comments.form.no_html' ) %] </td> </tr> --- 61,65 ---- <tr [% PROCESS row_color %]> <td colspan="2" align="center"> ! <font size="-1">[% MSG( 'comments.form.no_html' ) %]</font> </td> </tr> *************** *** 70,83 **** [% INCLUDE form_checkbox( name = 'remember_poster', value = 'yes', ! picked = form_settings.remember_poster ) %] </td> </tr> ! [% count = count + 1 %] <tr [% PROCESS row_color %]> <td colspan="2">[% MSG( 'comments.form.notify' ) %] ! [% INCLUDE form_checkbox( name = 'comment_notify', ! value = 'yes', ! picked = form_settings.comment_notify ) %] </td> </tr> --- 70,92 ---- [% INCLUDE form_checkbox( name = 'remember_poster', value = 'yes', ! picked = remember_poster ) %] </td> </tr> ! [%- count = count + 1; ! notify_list = [ { value = 'yes', label = MSG( 'comments.form.notify_no_sub' ) }, ! { value = 'no', label = MSG( 'comments.form.notify_no_unsub' ) } ] ! -%] ! [% IF is_subscribed == 'yes'; ! notify_list = [ { value = 'yes', label = MSG( 'comments.form.notify_yes_sub' ) }, ! { value = 'no', label = MSG( 'comments.form.notify_yes_unsub' ) } ]; ! END -%] <tr [% PROCESS row_color %]> <td colspan="2">[% MSG( 'comments.form.notify' ) %] ! [% INCLUDE form_select( name = 'is_subscribed', ! list = notify_list, ! value_field = 'value', ! label_field = 'label', ! picked = is_subscribed ) %] </td> </tr> |
From: Chris W. <la...@us...> - 2005-03-03 13:03:59
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4263/msg Modified Files: comments-messages-en.msg Log Message: OIN-112: add messages to support the new labels in the 'subscribe/unsubscribe' dropdown; also to support error/status messages for removing a notification Index: comments-messages-en.msg =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/msg/comments-messages-en.msg,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** comments-messages-en.msg 28 Feb 2005 01:56:12 -0000 1.7 --- comments-messages-en.msg 3 Mar 2005 13:03:48 -0000 1.8 *************** *** 7,10 **** --- 7,14 ---- comments.form.remember = Remember info? comments.form.notify = Email on new thread posts? + comments.form.notify_yes_sub = Yes, keep subscription + comments.form.notify_yes_unsub = No, unsubscribe + comments.form.notify_no_sub = Yes, subscribe to thread + comments.form.notify_no_unsub = No, do not subscribe to thread comments.form.preview = Preview comments.form.post = Post *************** *** 37,41 **** comments.notify.new_comment = A new comment has been posted on [_1] comments.status.add_ok = Comment successfully added. ! comments.status.add_notify_ok = Your notification entry added successfully. comments.error.data_missing = Data are required for the following fields: [_1] comments.error.cannot_fetch = Error fetching comment: [_1] --- 41,46 ---- comments.notify.new_comment = A new comment has been posted on [_1] comments.status.add_ok = Comment successfully added. ! comments.status.add_notify_ok = Your notification for this thread added successfully. ! comments.status.remove_notify_ok = Your notification for this thread removed successfully. comments.error.data_missing = Data are required for the following fields: [_1] comments.error.cannot_fetch = Error fetching comment: [_1] *************** *** 56,58 **** --- 61,64 ---- comments.error.cannot_add_notify_error_dupe_check = Failed to fetch existing notifications for dupe check, so I could not add yours. comments.error.cannot_add_notify_is_dupe = Did not add a notification to this thread since one already exists for the given email address. + comments.error.cannot_remove_notify = Failed to remove your notification for this thread: [_1] comments.error.cannot_add_notify_persist = Your notification entry addition failed, sorry. ([_1]) |
From: Chris W. <la...@us...> - 2005-03-03 13:03:30
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/comments/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4083/conf Modified Files: action.ini Log Message: add a title to the 'recent comments' box Index: action.ini =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/comments/conf/action.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** action.ini 28 Feb 2005 01:56:12 -0000 1.5 --- action.ini 3 Mar 2005 13:02:55 -0000 1.6 *************** *** 36,40 **** class = OpenInteract2::Action::Comments task = comment_recent ! url_none = yes is_secure = no ! default_comment_count = 5 \ No newline at end of file --- 36,41 ---- class = OpenInteract2::Action::Comments task = comment_recent ! title = Recent Comments is_secure = no ! default_comment_count = 5 ! url_none = yes |
From: Chris W. <la...@us...> - 2005-03-03 03:37:05
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1057 Modified Files: CleanOrphanedUsers.pm Log Message: OIN-91: when removing users disable security; add a few docs Index: CleanOrphanedUsers.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage/Website/CleanOrphanedUsers.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CleanOrphanedUsers.pm 26 Feb 2005 05:52:18 -0000 1.1 --- CleanOrphanedUsers.pm 3 Mar 2005 03:36:20 -0000 1.2 *************** *** 5,12 **** use strict; use base qw( OpenInteract2::Manage::Website ); - use Log::Log4perl qw( get_logger ); - use OpenInteract2::Constants qw( :log ); use OpenInteract2::Context qw( CTX ); - use OpenInteract2::Exception qw( oi_error ); $OpenInteract2::Manage::Website::CleanOrphanedUsers::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/); --- 5,9 ---- *************** *** 38,42 **** my @errors = (); foreach my $user ( @to_remove ) { ! eval { $user->remove }; if ( $@ ) { $failed++; --- 35,39 ---- my @errors = (); foreach my $user ( @to_remove ) { ! eval { $user->remove({ skip_security => 1 }) }; if ( $@ ) { $failed++; *************** *** 88,91 **** --- 85,100 ---- } + =head1 DESCRIPTION + + When a user registers for a new account the system enters a + 'removal_date' in their record. That date is the date of their + registration plus an expiration time. This expiration time is + specified in the server configuration key + 'login.initial_login_expires' or is set to 24 hours. + + When you run this task we find any users with non-null 'removal_date' + values and compare the date to right now. If it's less than now, we + remove the user. + =head1 STATUS INFORMATION |
From: Chris W. <la...@us...> - 2005-03-02 17:33:42
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/ActionResolver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1741 Modified Files: UserDir.pm Log Message: add inline comments (cosmetic) Index: UserDir.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/ActionResolver/UserDir.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UserDir.pm 2 Mar 2005 15:31:34 -0000 1.3 --- UserDir.pm 2 Mar 2005 17:33:32 -0000 1.4 *************** *** 20,26 **** --- 20,32 ---- my ( $self, $request, $url ) = @_; return undef unless ( $url =~ m|^/?~| ); + + # cleanup url to known state $url =~ s|^/||; $url =~ s/\?.*$//; $url =~ s|/$||; + my ( $username, $task, @params ) = split /\//, $url; + + # /~user same as /~user/display $task ||= 'display'; + my $action = CTX->lookup_action( 'user' ); $action->task( $task ); |