You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(267) |
Nov
(344) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(23) |
Feb
(15) |
Mar
(16) |
Apr
(388) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
From: <tw...@us...> - 2002-10-14 18:27:08
|
Update of /cvsroot/genex/genex-server/webtools In directory usw-pr-cvs1:/tmp/cvs-serv32624 Modified Files: Tag: Rel-1_0_1-branch choose_order.html edit_study2.pl sessionlib.pl choose_order_curator.html Added Files: Tag: Rel-1_0_1-branch delete_order1.html delete_order2.pl delete_order1.pl Log Message: implement confirmation for order delete finish date patch fixes --- NEW FILE: delete_order1.html --- <html><head><title>Confirm order delete</title></head> <body bgcolor="#FFFFFF"> <table border=0 cellpadding=0 cellspacing=0> <tr><td align=top><img src="../graphics/genex_logo.jpg" align="left">Confirm order delete<br><br> <a href="./">Return to Genex Member Home</a><br><br clear=all><br> </td> </tr> </table> <a href="./">Cancel</a> <br> <br> <loop> <table width=700 border=1 cellpadding=0 cellspacing=0> <tr> <td valign="top"> Order number: <b>{order_number}</b><br> Number of samples: {number_of_samples}<br> Study name / Protocol name / Run date / Number of hybridizations<br> {sample_info} </td> <td valign="top" width="30%"> <form action="delete_order2.pl" method=POST> <input type="hidden" name="oi_pk" value="{oi_pk}"> <input type="submit" name="submit" value="Delete this order now"> </form> This will delete order {order_number} and all of the samples in this order. </td> </tr> </table> </loop> <br> <br> </body> </html> --- NEW FILE: delete_order2.pl --- #!/usr/bin/perl use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); require "sessionlib.pl"; main: { my $q = new CGI; my $dbh = new_connection(); my $us_fk = get_us_fk($dbh); my $oi_pk = $q->param("oi_pk"); if (is_writeable($dbh, "order_info", "oi_pk", $oi_pk, $us_fk)) { delete_order_info($dbh, $oi_pk); } $dbh->commit; $dbh->disconnect; # # This script has no web page output. It only redirects # back to choose_order.pl # my $url = index_url(); # see sessionlib.pl $url =~ s/(.*)\/.*/$1\/choose_order.pl/; print "Location: $url\n\n"; exit(); } --- NEW FILE: delete_order1.pl --- #!/usr/bin/perl use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); require "sessionlib.pl"; main: { my $debug; my $sql; my $q = new CGI; my $dbh = new_connection(); # sessionlib.pl my $us_fk = get_us_fk($dbh); my $oi_pk = $q->param("oi_pk"); my $fclause; my $wclause; ($fclause,$wclause) = write_where_clause("order_info", "oi_pk", $us_fk ); $sql = "select order_number,oi_pk from order_info,$fclause where $wclause and oi_pk=$oi_pk order by order_number"; my $sth = $dbh->prepare($sql); $sth->execute(); (my $allhtml, my $loop_template) = readtemplate("delete_order1.html"); # readfile() is in sessionlib.pl my $recordlist = makelist($dbh, $sth, $us_fk, $loop_template); $allhtml =~ s/<loop_here>/$recordlist/sg; print "Content-type: text/html\n\n"; print "$allhtml\n"; $dbh->disconnect; exit(0); } sub makelist { (my $dbh, my $sth, my $us_fk, my $loop_template) = @_; my $sc_sql = "select count(*) from sample where oi_fk=?"; my $sc_sth = $dbh->prepare($sc_sql) || die "$sc_sql\n$DBI::errstr\n"; my $rec; # hash reference to a record my $looplist; # # Put all necessary data in to the $rec hash, and just loop through # the keys substituting into the HTML template. # This assumes that field names, and anything added to the $rec hash # is unique! # while($rec = $sth->fetchrow_hashref()) { $sc_sth->execute($rec->{oi_pk}) || die "$sc_sql\n$DBI::errstr\n"; ($rec->{number_of_samples}) = $sc_sth->fetchrow_array(); ($rec->{sample_info}) = sample_info($dbh, $us_fk, $rec->{oi_pk}); my $loop_instance = $loop_template; $loop_instance =~ s/{(.*?)}/$rec->{$1}/g; $looplist .= $loop_instance; } return $looplist; } sub sample_info { (my $dbh, my $us_fk, my $oi_pk) = @_; (my $fclause, my $wclause) = read_where_clause("sample", "smp_pk", $us_fk ); my $sql = "select smp_pk,timestamp, exp_condition.name, study.study_name from sample,exp_condition,study,$fclause where study.sty_pk=exp_condition.sty_fk and exp_condition.ec_pk=sample.ec_fk and oi_fk=$oi_pk and $wclause order by smp_pk"; my $sth = $dbh->prepare($sql) || die "$sql\n$DBI::errstr\n"; $sth->execute() || die "$sql\n$DBI::errstr\n"; my $hyb_sql = "select count(am_pk) from arraymeasurement where smp_fk=?"; my $hyb_sth = $dbh->prepare($hyb_sql); my $rec; my $results; my $xx = 0; while($rec = $sth->fetchrow_hashref()) { $hyb_sth->execute($rec->{smp_pk}); ($rec->{number_of_hybridizations}) = $hyb_sth->fetchrow_array(); $rec->{timestamp} = sql2date($rec->{timestamp}); $xx++; # we want a one's based counting number in the line below, so increment here. $results .= "$xx: $rec->{study_name} / $rec->{name} / $rec->{timestamp} / $rec->{number_of_hybridizations}<br>"; } return ($results, $xx); } Index: choose_order.html =================================================================== RCS file: /cvsroot/genex/genex-server/webtools/Attic/choose_order.html,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** choose_order.html 24 Sep 2002 13:33:23 -0000 1.1.2.6 --- choose_order.html 14 Oct 2002 18:27:05 -0000 1.1.2.7 *************** *** 33,37 **** <td valign="top" width="30%"> ! <form action="delete_order.pl" method=POST> <input type="hidden" name="oi_pk" value="{oi_pk}"> <input type="submit" name="submit" value="Delete"> --- 33,37 ---- <td valign="top" width="30%"> ! <form action="delete_order1.pl" method=POST> <input type="hidden" name="oi_pk" value="{oi_pk}"> <input type="submit" name="submit" value="Delete"> Index: edit_study2.pl =================================================================== RCS file: /cvsroot/genex/genex-server/webtools/Attic/edit_study2.pl,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -C2 -d -r1.1.2.14 -r1.1.2.15 *** edit_study2.pl 11 Oct 2002 15:16:10 -0000 1.1.2.14 --- edit_study2.pl 14 Oct 2002 18:27:05 -0000 1.1.2.15 *************** *** 65,76 **** my %ch = $q->Vars(); ! (my $fclause, my $wclause) = read_where_clause("study", "sty_pk", $us_fk ); ! my $sql_sn = "select study_name from study,$fclause where $wclause and study_name=? and sty_pk<>?"; ! my $sth_sn = $dbh->prepare($sql_sn); ! $sth_sn->execute($ch{study_name}, $ch{sty_pk}); ! if ($sth_sn->rows() > 0) ! { ! $message = "5m"; ! } # # Actually, we'll die inside is_writeable() if it fails. --- 65,70 ---- my %ch = $q->Vars(); ! $message .= verify_study($dbh, $us_fk, \%ch); ! # # Actually, we'll die inside is_writeable() if it fails. Index: sessionlib.pl =================================================================== RCS file: /cvsroot/genex/genex-server/webtools/Attic/sessionlib.pl,v retrieving revision 1.1.2.36 retrieving revision 1.1.2.37 diff -C2 -d -r1.1.2.36 -r1.1.2.37 *** sessionlib.pl 11 Oct 2002 15:16:13 -0000 1.1.2.36 --- sessionlib.pl 14 Oct 2002 18:27:05 -0000 1.1.2.37 *************** *** 36,39 **** --- 36,59 ---- } + + # + # Check for study unique name, and return appropriate message string + # + sub verify_study + { + my $dbh = $_[0]; + my $us_fk = $_[1]; + my %ch = %{$_[2]}; + + (my $fclause, my $wclause) = read_where_clause("study", "sty_pk", $us_fk ); + my $sql_sn = "select study_name from study,$fclause where $wclause and study_name=? and sty_pk<>?"; + my $sth_sn = $dbh->prepare($sql_sn); + $sth_sn->execute($ch{study_name}, $ch{sty_pk}); + if ($sth_sn->rows() > 0) + { + return "5m"; + } + return ""; + } # # It seems odd that some of these don't require /s; Index: choose_order_curator.html =================================================================== RCS file: /cvsroot/genex/genex-server/webtools/Attic/choose_order_curator.html,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** choose_order_curator.html 26 Sep 2002 21:17:22 -0000 1.1.2.10 --- choose_order_curator.html 14 Oct 2002 18:27:05 -0000 1.1.2.11 *************** *** 18,21 **** --- 18,22 ---- <div align="right"> <input type=hidden name="oi_pk" value={oi_pk}> + <font color="#FF0000">{message}</font> Owner: </div> </td> |
From: <tw...@us...> - 2002-10-14 18:24:59
|
Update of /cvsroot/genex/genex-server/webtools In directory usw-pr-cvs1:/tmp/cvs-serv31675 Removed Files: Tag: Rel-1_0_1-branch delete_order.pl Log Message: see new files delete_order1.* and delete_order2.* --- delete_order.pl DELETED --- |
From: <tw...@us...> - 2002-10-14 13:37:50
|
Update of /cvsroot/genex/genex-server/html In directory usw-pr-cvs1:/tmp/cvs-serv18822 Added Files: Tag: Rel-1_0_1-branch schema_changes.html Log Message: This file has been around for a while, but somehow missed being checked in. --- NEW FILE: schema_changes.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>GeneX Schema Changes</title> </head> <body bgcolor="#FFFFFF" link="#006633" vlink="#666633" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" > <table width="760" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td width="20"> </td> <td width="160"><font face="Verdana, Arial, Helvetica, sans-serif" size="+1"><a href="./index.shtml">GeneX</a></font></td> <td width="580"><font face="Verdana, Arial, Helvetica, sans-serif" size="+1">GeneX: Database Schema Change History</font> <br> </td> </tr> </table> <br> <br> <table width="760" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20"><img src="graphics/cleargif.gif" width="20"></td> <td width="160" valign="top"><img src="graphics/cleargif.gif" width="160"></td> <td width="580" valign="top"> GeneX Schema changes<br> <br> (March 2002)<br> 1) Created genex_schema.sql which contains the now modified schema, and minimal data for two tables: "contacttype"and "species". The other tables are empty.<br> <br> The new schema is free of experimentor data and test data. We have moved test data into separate files. This simplifies the installation and testing of a new GeneX site. After the test phase, is it easy to create a clean database.<br> <br> (April 2002) <br> Table additions and deletions in support of security model:<br> <br> 1) The "us_fk" and "gs_fk" fields were removed from all tables. These fields existed in support of the original proposed security model and are no longer used by the new model. Fields "us_fk" and "gs_fk" remain in the new security tables ("usersec", "groupsec", "groupref").<br> <br> 2) "sessions" - This table is not currently in use but has been reserved for possible deployment in the future. Current sessioning is based on Apache's .htaccess authorization model, and may need future improvement.<br> <br> 3) "groupref" - This one table will hold the primary key values for all secured tables as well as data pertaining to user and group permissions By keeping all these primary key values in the groupref table we can easily implement row level security. No primary key value will repeat across the secured tables. The "us_fk" and "gs_fk" fields will link to the users and/or groups that have access to viewing the data. The "is_group_rw" field will identify rows of data which are writable by particular groups and users. Our current somewhat simplified model assumes that the user (owner) always has read-write (rw) abilities. Group permissions may be read-only (ro) or rw as controlled by the is_group_rw field. The "groupref" table is further described in the security system documentation.<br> <br> 4) "pk_seq" - A sequence which generates the primary key values for all the secured tables. These tables will no longer have their own individual sequences for primary key generation. The following is a list of the sequence tables that were removed:<br> <br> arraylayout_al_pk_seq<br> arraymeasurement_am_pk_seq<br> blasthits_bh_pk_seq<br> chromosome_chr_pk_seq<br> citation_cit_pk_seq<br> contact_con_pk_seq<br> experimentfactors_ef_pk_seq<br> experimentset_es_pk_seq<br> protocol_prt_pk_seq<br> sample_smp_pk_seq<br> scanner_scn_pk_seq<br> software_sw_pk_seq<br> species_spc_pk_seq<br> spotter_sptr_pk_seq<br> treatmentlevel_tl_pk_seq<br> usersec_us_pk_seq<br> <br> (*Note: Tables that have the potential to get very large have been secured indirectly through linking tables. For example, the "al_spots" table will not receive a primary key through the "pk_seq" but will be implicitly secured as it can only be accessed through the "arraylayout" table which has been secured. The same goes for the "am_spots" tables which will be indirectly secured through the "arraymeasurement" table.)<br> <br> 5) "guc_seq" - (guc is mnemonic for group-user-contact) This sequence was added to generate primary key values for three of the security tables "groupsec," "usersec," and "contact." When users are created using the admin_cli.pl script, the "contact" table is populated first and then "usersec" and "groupsec" are populated using the same value in the primary key field as was generated for "contact". In other words, the "contact" primary key (con_pk), "usersec" primary key (us_pk), and "groupsec" primary key (gs_pk) are identical for a given user This format helps to simplify much of the associated code.<br> <br> Groups can be created separate from the addition of new accounts, so the "groupsec" primary key will increase sequentially without any modification to the "contact" or "usersec" tables. When users create additional groups the "guc_seq" is incremented. This leaves what might seem to be an apparent gap in the sequence of contact/user/group primary keys, but makes no difference in the perfermonance or function of the database.<br> <br> <br> (end April 2002)<br> Additions of other tables:<br> <br> 1) "billing" - This table was created specifically for our Biomolecular Research Facility (BRF). The table can be ignored or modiified to accommodate the needs of other universities. <br> <br> 2) "order_info" - This table was created specifically for our Biomolecular Research Facility (BRF) and is used to hold data regarding orders placed by UVA experimenters. The table can be ignored or modiified to accommodate the needs of other institutions.<br> <br> 3) "order_seq" - This sequence was created to assist in the construction of a unique string value associated with each hybridization. Known as the "hybridization_name" in the arraymeasurement table, this field represents a concatenation of values: a two digit value representing the year, a sequential value taken from this sequence, the name of the sample, a chip designation, and a hybridization indicator. It is used by the GeneX web interface to present hybridization data and related meta-data. It is also used by our Biomolecular Research Facility as a means to track their samples/experiments.<br> <br> 4) "quality_control" - The QC table was also created specifically for the BRF. Sets of QC data exist for every chip (hybridization) and are entered directly by BRF. <br> <br> 5) "sampletype" - The sampletype table was created so that the list of sample types could be limited to a select few. A drop down box appears on the corresponding web interface page.<br> <br> <br> (end April 2002)<br> Modifications of existing GeneX tables:<br> <br> 1) The "groupsec" table came from the original GeneX schema but some changes were made to accommodate our security model.<br> "gs_owner" was added to the table to reflect the individual who owns the data. <br> "group_name" was shortened and standardized to "gs_name"<br> The "groupsec_group_name_key" index was changed to "groupsec_gs_name_key" due to the field name change above.<br> <br> 2) "contact" table changes: <br> change "contact_person" to "contact_fname" and "contact_lname" (first name and last name)<br> change "contact_person_phone" to "contact_phone" to simplify name<br> change "contact_person_email" to "contact _email" to simplify name<br> add "department"<br> add "room_number"<br> add "building"<br> <br> 3) "arraymeasurement" table changes:<br> add "qc_fk" as a foreign key to quality_control table. There will be one set of quality control data per hybridization.<br> add comments field for various items including lab notebook value when available.<br> <br> 4) "experimentset" table changes:<br> remove us_fk and gs_fk fields in support of new security model<br> add experiment_notes (text) field for use by experimenters<br> add "locked" boolean field so that experimentors can be prevented from changing experimental meta data and sample hybridization <br> selection after samples have been delivered to the chip bioassay lab.<br> <br> 5) "sample" table changes:<br> add "oi_fk" as a foreign key to the order_info table<br> add "sample_name" - a short description provided by the experimenter. Will be used as part of unique hybridization_name <br> (arraymeasurement table). <br> add "type" as link to sampletype table<br> add "sample_description" - to be provided by the experimenter<br> add "sample_treatment" - to be provided by the experimenter<br> <br> <br> (May 2nd, 2002)<br> 6) "am_spots" table changed to "am_spots_mas5" - The original Genex 1 schema contained multiple rows in the arraymeasurement table for each hybridization. Each row was representative of one of the derived values for that hybridization (i.e we are currently storing values for 5 different measurements from a MAS 5.0 data spreadsheet). Having multiple rows per hybridization caused duplication in the smp_fk, qc_fk, type, description, primary_es_fk and al_fk fields.<br> <br> This duplication presented a problem in identifying replicates. We decided to resolve this problem by breaking the am_spots tables into several tables, one for each type of stored data: Affymetrix MAS version 5.0, Affymetrix MAS version 4.0, and cDNA data. Each table will store the derived values as well as the meta data specifically asssociated with that kind of data. By moving these fields into the appropriate am_spots tables we can eliminate duplication of data within the arraymeasurement table. We have also provided a column based presentation of spots data which decreases the number of rows within each of the am_spots tables. Replicates can now be identified by those entries in the arraymeasurement table that have the same sample (smp_fk).<br> <br> 7) "am_spots_ams_pk_seq" sequence changed to match the new "am_spots_mas5" table. The convention used in Jason's Bio::Genex database classes is tablename_pkname_seq. Thus table "am_spots_mas5" with pk "ams_pk" becomes "am_spots_mas5_ams_pk_seq".<br> <br> <br> <br> (May 10, 2002)<br> Schema additions:<br> <br> 1) "am_spots_mas4" table was added to hold data from Affymterix Software, version 4. The name of the primary key for this table as well as the names of indexes remain as they exist for the version 5 am_spots table. Other than the slight difference in the table name the only other difference will be the name of the columns related to the type of derived values stored. All other fields will look the same. We do not anticipate that this will cause any confusion as the web interface will most likely not query both tables simultaneously. If the need for this arrives we would merely need to preceed the field names with the table name to reduce confusion (i.e. am_spots_mas5.ams_pk or am_spots_mas4.ams_pk).<br> <br> 2) "am_spots_mas4_ams_pk_seq" - This sequence was added for purposes of generating a serial primary key value for the am_spots_mas4 table.<br> <br> 3) Three indexes (similar to those for the am_spots_mas5 table) were created for the am_spots_mas4 table. The names of the indexes had to be modified slightly as postgresql will not allow indexes of the same name to exist in one database. <br> am_spots4_pkey<br> ams4_am_fk_ind<br> ams4_usf_fk_ind<br> <br> <br> (July 2002)<br> Schema Additions:<br> <br> 1) "study" table was created to house information pertaining to an investigator's study (or research). Investigators can have one or more studies listed in the table.<br> <br> 2) The "am_spots_dchip" table was added as an additional spots data table. It will hold derived values from dchip software and will closely resemble the format of the other spots tables.<br> <br> 3) A "file_info" table was created to hold information pertaining to various user files. These files are stored in personal directories located on the server. The attributes consist of the filename, a comments field where users can store information regarding the contents of the file, and a checksum which will be used by the system to retrieve the file.<br> <br> <br> (July 2002)<br> Table Modifications:<br> <br> 1) One of the larger changes made to the original GeneX 1 schema involves the removal of the experimentset table in favor of an experimental conditions table, known as "exp_condition." The experimentset table presented an issue in terms of how the experiments were being grouped. The schema now reflects a more practical view of the data. The exp_condition table reflects the attributes unique to one experimental condition or treatment. Many samples can be linked back to one experimental condition. By creating the experimental condition table and moving many of the sample table fields we have eliminated a lot of duplication which existed in the original sample table.<br> <br> 2) Modifications to sample and new exp_condition table:<br> - delete "sample_name" from sample. Now using "name" field in exp_condition table.<br> - merge "type" from experimentset table and "sample_name" to "sample_name" in exp_condition table.<br> - merge "sample_description" to "description" in exp_condition table.<br> - delete biology_description from what is now exp_condition table.<br> - change "experiment_notes" to "notes" in exp_condition. <br> - add "ec_fk" to sample table.<br> - add "abbrev_name" to exp_condition for use in autogenerating unique hybridization name.<br> - change "phenotype_name" to "phenotype" in what is now exp_condition table.<br> - add "type," "quantity," "unit," "time_series," and "time_point" to exp_condition table.<br> - add "lab_book" and "lab_book_owner" to sample table.<br> - add "timestamp" to sample table to reflect time sample was run by experimentor. May be useful to differentiate between portions of same sample.<br> - add foreign key to study table (sty_fk) from exp_condition.<br> <br> 3) Remove "is_public," "release_date," "submission_date," "archive_bundle_ref," and "provider_con_fk" from what is now exp_condition (old experimentset) table:<br> <br> 4) Change the es_pk field in the old experimentset table to ec_pk in the experimental_condition table.<br> <br> 5) Change the es_fk in the following tables to ec_fk:<br> experimentalfactors<br> hotspots<br> treatmentlevel<br> arraymeasurement<br> order_info<br> <br> 6) Delete "primary_es_fk" from arraymeasurement table. Link no longer required. Access to arraymeasurement will be through the exp_condition table through the sample table .<br> <br> 7) The following indexes were related to the experimentset table and were modified to reflect change to exp_condition table.<br> experimentfactors table: "ef_es_fk_ind" was changed to "ef_ec_fk_ind"<br> "experimentfactors_es_fk_key" to "experimentfactors_ec_fk_key"<br> hotspots: "hs_es_fk_ind" to "hs_ec_fk_ind"<br> treatmentlevel: "tl_es_fk_ind" to "tl_ec_fk_ind"<br> arraymeasurement: "am_primary_es_fk" to "am_primary_ec_fk"<br> <br> 8) Delete "is_public" and "group_can_update" from arraymeasurement table. These fields are no longer useful given new security model.<br> <br> 9) Delete "name" from arraymeasurement. This field stored the name of derived value when mulitple records were being stored per hybridization. These names are now stored in the spots tables.<br> <br> 10) Add "dic_" to the following dictionary (i.e. lookup) tables to make identification of these tables more apparent:<br> al_coating<br> al_defaultspotconcunits<br> al_identifiercode<br> al_medium<br> al_technologytype<br> als_spottype<br> am_equationtype<br> am_spotmeasurementunits<br> am_suspectspots<br> am_type<br> contacttype<br> ef_majorcategory<br> ef_minorcategory<br> hs_thresholdtype<br> prt_type<br> smp_ageunits<br> smp_developmentstagename<br> smp_developmentstageunits<br> smp_geneticstatus<br> smp_organismintactness<br> smp_organtype<br> smp_primarycelltype<br> smp_sexmatingtype<br> smp_tissuetype<br> spc_cellstructure<br> spc_generalclassification<br> spt_modeldescription<br> <br> 11) Add "billing_code" field to billing table.<br> <br> 12) Moved "locked" field from exp_condition to order_info table.<br> <br> 13) Change "is_group_rw" filed3xPar1s<br> </td> </tr> </table> <p> </p> </body> </html> |
From: <mwi...@us...> - 2002-10-13 22:23:28
|
Update of /cvsroot/genex/genex-server/G2G/mason In directory usw-pr-cvs1:/tmp/cvs-serv30473 Added Files: generate_user.html.in Log Message: mason HTML template to create new genex user --- NEW FILE: generate_user.html.in --- % if (($response_page eq "NEW") || ($response_page eq "badUP") || ($response_page eq "badORG")) { <center> response page <% $response_page %><br> <h1>Create New Genex User</h1> <form action="generate_user.html"><br> <br> % if ($response_page eq "badUP"){ <h3><font color="red">Your username/password combination were invalid, or your passwords did not match</font></h3> % $username = ""; $password = ""; $password2=""; % } % if ($response_page eq "badORG"){ <h3><font color="red">You must provide an organization name</font></h3> % $organization = ""; % } <table cellpadding="2" cellspacing="2" border="0" style="width: 70%; text-align: left; margin-left: auto; margin-right: auto;" title="Enter the following information for your user" summary="information about the new genex user"> <caption><br> </caption> <tbody> <tr> <td valign="top">New Username<br> </td> <td valign="top"><input name="username" type="text" width="12" value="<% $username %>"></td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top">New Password<br> </td> <td valign="top"><input name="password" type="password" width="12" value="<% $password %>"></td> <td valign="top">Confirm Password<br> </td> <td valign="top"><input name="password2" type="password" width="12" value="<% $password2 %>"></td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top">Organization:<br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Name<br> <br> </td> <td valign="top"><input name="organization" type="text" width="30" value="<% $organization %>"> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Phone<br> <br> </td> <td valign="top"><input name="org_phone" type="text" width="30" value="<% $org_phone %>"> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Toll-free<br> <br> </td> <td valign="top"><input name="org_toll_free_phone" type="text" value="<% $org_toll_free_phone %>" width="30"></td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Fax<br> <br> </td> <td valign="top"><input name="org_fax" type="text" width="30" value="<% $org_fax %>"> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Email<br> </td> <td valign="top"><input name="org_email" type="text" width="30" value="<% $org_email %>"> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">URL<br> <br> </td> <td valign="top"><input name="url" type="text" width="30" value="<% $url %>"></td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Mailing Address<br> </td> <td valign="top" colspan="2"><textarea width="40" height="7" name="org_mail_address"><% $org_mail_address %></textarea></td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top">Contact:<br> <br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Name<br> <br> </td> <td valign="top"><input type="text" name="contact_person" width="30" value="<% $contact_person %>"></td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Phone<br> <br> </td> <td valign="top"><input type="text" name="contact_person_phone" width="30" value="<% $contact_person_phone %>"></td> <td valign="top"><br> <br> </td> </tr> <tr> <td valign="top"><br> <br> </td> <td valign="top">Email<br> <br> </td> <td valign="top"><input type="text" name="contact_person_email" width="30" value="<% $contact_person_email %>"></td> <td valign="top"><br> <br> </td> </tr> </tbody> </table> <br> <input name="submitted" type="hidden" value="true"> <input type="submit" name="submit" value="Create This User"><br> <br> <br> last modified Oct 11, 2002<br> </center> % } % if ($response_page eq "DONE"){ <div style="text-align: center;"> <h1>Genex User Created</h1> % } <%attr> action=>'%%GENEX_WORKSPACE_URL%%/generate_user.html' name=>'Create New Genex User' path=>'%%GENEX_WORKSPACE_URL%%/generate_user.html' </%attr> <%args> $username => "" $password => "" $password2 => "" $organization => "" $org_phone => "" $org_toll_free_phone => "" $org_fax => "" $org_email => "" $org_mail_address => "" $url => "" $contact_person => "" $contact_person_phone => "" $contact_person_email => "" $submitted => "" $debug => 0 </%args> <%once>; </%once> <%init>; use Carp; use Getopt::Long; use File::Basename; %%GENEX_EXTRALIBS%% use Bio::Genex;# qw(timestamp $SU_USERNAME $SU_PASSWORD); use Bio::Genex::Connect; use Bio::Genex::UserSec; use Bio::Genex::Contact; use Bio::Genex::GroupLink; #my $ro_groupname = %%GENEX_RO_GROUPNAME%%; #my $rw_groupname = %%GENEX_RW_GROUPNAME%%; my $ro_groupname = "public"; my $rw_groupname = "superuser"; my $SU_USERNAME = "superuser"; my $SU_PASSWORD = "superuser"; my $response_page; my $dbname = "%%DB_NAME%%"; $SU_USERNAME = "genex"; $SU_PASSWORD = "genex"; $rw_groupname = $rw_groupname?$rw_groupname:"superuser"; # set predictable default if this variable doesn't exist; unless ($submitted eq "true"){ $response_page="NEW"; } else { if (((!$username) && (!$password)) || ($password ne $password2)){ $response_page="badUP"; } elsif (!$organization){ $response_page="badORG"; } else { my $db=Bio::Genex::Connect->new(USER=>$SU_USERNAME, PASSWORD=>$SU_PASSWORD, DBNAME=>$dbname); my $sth = $db->prepare("create user $username with password '$password' nocreatedb nocreateuser"); unless ($sth) {$response_page="badUP"; } else { $sth->execute(); my $u = Bio::Genex::UserSec->new(dbh=>$db); my $c = Bio::Genex::Contact->new(dbh=>$db); #okay, start filling in the database $u->username($username); # create username # now create organization details $c->organization($organization); $c->contact_person($contact_person); $c->contact_person_phone($contact_person_phone); $c->contact_person_email($contact_person_email); $c->org_phone($org_phone); $c->org_email($org_email); $c->org_mail_address($org_mail_address); $c->org_toll_free_phone($org_toll_free_phone); $c->org_fax($org_fax); $c->url($url); $c->ro_groupname($ro_groupname); $c->rw_groupname($rw_groupname); my $cid = $c->insert_db($db); $u->con_fk($cid); $u->ro_groupname($ro_groupname); $u->rw_groupname($rw_groupname); $u->insert_db($db); my $gl = Bio::Genex::GroupLink->new; $gl->username($u->username); $gl->groupname($ro_groupname); $gl->insert_db($db); $response_page="DONE"; } } } </%init> |
From: <jas...@us...> - 2002-10-13 19:19:12
|
Update of /cvsroot/genex/genex-server/Genex/scripts In directory usw-pr-cvs1:/tmp/cvs-serv13424/Genex/scripts Modified Files: user-insert.pl.in Log Message: more support for customizing user insertion Index: user-insert.pl.in =================================================================== RCS file: /cvsroot/genex/genex-server/Genex/scripts/user-insert.pl.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** user-insert.pl.in 13 Oct 2002 19:11:49 -0000 1.2 --- user-insert.pl.in 13 Oct 2002 19:19:09 -0000 1.3 *************** *** 120,129 **** ) unless defined $su_group; ! print "Adding security group for new user\n"; ! my $g = Bio::Genex::GroupSec->new(name=>$OPTIONS{new_user}, ! ro_groupname_obj=>$pub_group, ! rw_groupname_obj=>$su_group, ! description=>"$OPTIONS{new_user}'s group" ! ); $g->insert_db($dbh); $dbh->error(@error_args, --- 120,135 ---- ) unless defined $su_group; ! my $g; ! unless ($OPTIONS{no_group}) { ! print "Adding security group for new user\n"; ! $g = Bio::Genex::GroupSec->new(name=>$OPTIONS{new_user}, ! ro_groupname_obj=>$pub_group, ! rw_groupname_obj=>$su_group, ! description=>"$OPTIONS{new_user}'s group" ! ); ! } else { ! $g = $su_group; ! } ! $g->insert_db($dbh); $dbh->error(@error_args, *************** *** 177,193 **** ) if $dbh->err; ! # user is in his own group ! my $gl = Bio::Genex::GroupLink->new(username_obj=>$u, ! groupname_obj=>$g); ! ! $gl->insert_db($dbh); ! $dbh->error(@error_args, ! message=>"Couldn't insert user into private group", ! ) if $dbh->err; print "Adding user to public group\n"; ! $gl = Bio::Genex::GroupLink->new(username_obj=>$u, ! groupname_obj=>$pub_group); $gl->insert_db($dbh); --- 183,200 ---- ) if $dbh->err; ! unless ($OPTIONS{no_group}) { ! # user is in his own group ! my $gl = Bio::Genex::GroupLink->new(username_obj=>$u, ! groupname_obj=>$g); + $gl->insert_db($dbh); + $dbh->error(@error_args, + message=>"Couldn't insert user into private group", + ) if $dbh->err; + } print "Adding user to public group\n"; ! my $gl = Bio::Genex::GroupLink->new(username_obj=>$u, ! groupname_obj=>$pub_group); $gl->insert_db($dbh); |