Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-users-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 9 Nov 2001 01:11:31 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 10 Nov 2001 18:03:23 -0000 1.4 @@ -21,7 +21,8 @@ references users(user_id) constraint dlrn_user_id_pk primary key, - role varchar(100) not null, + role varchar(100) default 'user' not null check (role in ('student','guest','professor','admin')), + theme_id references portal_element_themes(theme_id), page_id integer constraint dlrn_user_page_id_fk references portals(portal_id) Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 6 Nov 2001 21:46:49 -0000 1.6 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 10 Nov 2001 18:03:23 -0000 1.7 @@ -32,4 +32,20 @@ return [ad_parameter group_type_key] } + ad_proc -public get_user_theme { + user_id + } { + Return the user default theme + } { + return [db_string select_user_theme {}] + } + + ad_proc -public set_user_theme { + user_id + theme_id + } { + Set the user theme + } { + db_dml update_user_theme {} + } } Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql 20 Sep 2001 21:04:56 -0000 1.2 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql 10 Nov 2001 18:03:23 -0000 1.3 @@ -20,4 +20,16 @@ + + +select theme_id from dotlrn_users where user_id = :user_id + + + + + +update dotlrn_users set theme_id= :theme_id where user_id= :user_id + + + Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 6 Nov 2001 21:46:49 -0000 1.3 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 10 Nov 2001 18:03:23 -0000 1.4 @@ -47,13 +47,30 @@ db_dml remove_user {} } + ad_proc -private user_get_role { + user_id + } { + returns the dotLRN user role or empty string if not a dotLRN user + } { + return [db_string select_user_role {} -default ""] + } + ad_proc -public guest_add { community_id user_id } { Add a guest to a particular community } { - db_dml add_guest {} + db_transaction { + # Check if this user is a user already + if {[empty_string_p [user_get_role $user_id]]} { + # Add the user as a guest + user_add -role guest $user_id + } + + # Subscribe the guest to that community + dotlrn_community::add_user $community_id $user_id + } } ad_proc -public guest_remove { @@ -62,7 +79,7 @@ } { Remove a guest from a particular community } { - db_dml remove_guest {} + dotlrn_community::remove_user $community_id $user_id } ad_proc -public user_can_browse_p { Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 5 Nov 2001 22:34:23 -0000 1.1 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 10 Nov 2001 18:03:23 -0000 1.2 @@ -2,6 +2,12 @@ + + +select role from dotlrn_users where user_id = :user_id + + + update dotlrn_users set page_id= :page_id Index: openacs-4/packages/dotlrn/www/preferences.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/preferences.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/preferences.adp 10 Nov 2001 18:03:23 -0000 1.1 @@ -0,0 +1,4 @@ + +dotLRN Preferences + + Index: openacs-4/packages/dotlrn/www/preferences.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/preferences.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/preferences.tcl 10 Nov 2001 18:03:23 -0000 1.1 @@ -0,0 +1,30 @@ + +ad_page_contract { + Preferences for dotLRN + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-10 +} { +} + +# Make sure user is logged in +set user_id [ad_maybe_redirect_for_registration] + +form create preferences + +element create preferences theme_id \ + -label "Portal Theme" -datatype text -widget select + +if {[form is_valid preferences]} { + template::form get_values preferences theme_id + + dotlrn::set_user_theme $user_id $theme_id + ad_returnredirect "./" + return +} else { + db_1row select_prefs {} + + element set_properties preferences theme_id -set_value $theme_id +} + +ad_return_template Index: openacs-4/packages/dotlrn/www/preferences.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/preferences.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/preferences.xql 10 Nov 2001 18:03:23 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + +select theme_id from dotlrn_users where user_id= :user_id + + + + Index: openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl 7 Nov 2001 20:20:56 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl 10 Nov 2001 18:03:23 -0000 1.2 @@ -30,12 +30,8 @@ if {[form is_valid add_class_instance]} { template::form get_values add_class_instance class_key pretty_name year term description - ns_log Notice "got values from form" - set class_instance_id [dotlrn_class::new_instance -description $description $class_key $pretty_name $term $year] - ns_log Notice "created class instance: $class_instance_id" - ad_returnredirect "one-class?class_key=$class_key" return } Index: openacs-4/packages/dotlrn/www/admin/user-new-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-new-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/user-new-2.adp 10 Nov 2001 18:03:23 -0000 1.1 @@ -0,0 +1,21 @@ + +dotLRN Admin: Add a User + +You've chosen to add @first_names@ @last_name@. +

+ +

+ + +Choose a role: + + + + +
+ + Index: openacs-4/packages/dotlrn/www/admin/user-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-new-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 7 Nov 2001 20:20:56 -0000 1.2 +++ openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 10 Nov 2001 18:03:23 -0000 1.3 @@ -1,15 +1,14 @@ ad_page_contract { - Add an actual user + Choose a role @author Ben Adida (ben@openforce.net) @creation-date 2001-11-04 } { user_id } -# Add the user -dotlrn::user_add $user_id +db_1row select_user_info "select first_names,last_name from registered_users where user_id= :user_id" -ad_returnredirect "users" +ad_return_template Index: openacs-4/packages/dotlrn/www/admin/user-new-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/user-new-3.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/www/admin/user-new-3.tcl 10 Nov 2001 18:03:23 -0000 1.1 @@ -0,0 +1,16 @@ + +ad_page_contract { + Add an actual user + + @author Ben Adida (ben@openforce.net) + @creation-date 2001-11-04 +} { + user_id + {role user} +} + +# Add the user +dotlrn::user_add -role $role $user_id + +ad_returnredirect "users" + Index: openacs-4/packages/dotlrn/www/admin/users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/users.adp 7 Nov 2001 20:20:56 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/users.adp 10 Nov 2001 18:03:23 -0000 1.2 @@ -4,7 +4,7 @@

dotLRN users

    -
  • @users.last_name@, @users.first_names@ +
  • @users.last_name@, @users.first_names@ (@users.email@) - @users.role@
Index: openacs-4/packages/dotlrn/www/admin/users.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/users.xql 7 Nov 2001 20:20:56 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/users.xql 10 Nov 2001 18:03:23 -0000 1.2 @@ -4,7 +4,7 @@ -select first_names, last_name from dotlrn_users, registered_users where dotlrn_users.user_id= registered_users.user_id +select first_names, last_name, email, role from dotlrn_users_full order by last_name