Commit 0b42b0d1 authored by Malte Sussdorff's avatar Malte Sussdorff

Initial import for 3.3

parent 021887b3
......@@ -7,18 +7,20 @@
<initial-install-p>t</initial-install-p>
<singleton-p>t</singleton-p>
<version name="5.1.5" url="http://openacs.org/repository/download/apm/acs-admin-5.1.5.apm">
<version name="5.3.1b1" url="http://openacs.org/repository/download/apm/acs-admin-5.3.1b1.apm">
<owner url="mailto:dhogaza@pacifier.com">Don Baccus</owner>
<summary>An interface for Site-wide administration of an OpenACS Installation.</summary>
<maturity>3</maturity>
<release-date>2004-02-28</release-date>
<release-date>2007-04-15</release-date>
<vendor url="http://openacs.org">OpenACS</vendor>
<license url="http://www.gnu.org/copyleft/gpl.html">GPL</license>
<maturity>3</maturity>
<description format="text/html">Provides a UI for administering site-wide services
(including package installation, cache, authentication, and user accounts) for an OpenACS system.
</description>
<provides url="acs-admin" version="5.1.4"/>
<requires url="acs-kernel" version="5.0.0"/>
<provides url="acs-admin" version="5.3.1b1"/>
<requires url="acs-kernel" version="5.3.1b1"/>
<callbacks>
</callbacks>
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<message_catalog package_key="acs-admin" package_version="5.3.0" locale="en_US" charset="ISO-8859-1">
<msg key="Service">Service</msg>
<msg key="Pages">Pages</msg>
<msg key="Visit_service_pages">Visit service pages</msg>
<msg key="Administration">Administration</msg>
<msg key="Service_administration">Service administration</msg>
<msg key="Site-Wide_Admin">Site-Wide Admin</msg>
<msg key="Parameters">Parameters</msg>
<msg key="Service_parameters">Service parameters</msg>
<msg key="Edit_callback">Edit callback</msg>
<msg key="Type">Type</msg>
<msg key="Tcl_Proc">Tcl Proc</msg>
<msg key="Invoke">Invoke</msg>
<msg key="Invoke_this_callback_proc_now_Be_careful">Invoke this callback proc now. Be careful!</msg>
<msg key="Delete_callback">Delete callback</msg>
<msg key="Package_Manager">Package Manager</msg>
<msg key="Add_callback">Add callback</msg>
<msg key="Tcl_Callbacks">Tcl Callbacks</msg>
<msg key="Name">Name</msg>
<msg key="General">General</msg>
<msg key="Short_Name">Short Name</msg>
<msg key="Authority_short_name_help_text">This is used when referring to the authority in parameters etc. Even if you need to change the display name above, this should stay unchanged.</msg>
<msg key="Enabled">Enabled</msg>
<msg key="Help_contact_text">Help contact text</msg>
<msg key="Help_contact_help_text">Contact information (phone, email, etc.) to be displayed as a last resort when people are having problems with an authority.</msg>
<msg key="Authentication">Authentication</msg>
<msg key="Password_Management">Password Management</msg>
<msg key="Recover_password_URL">Recover password URL</msg>
<msg key="Recover_password_URL_help_text">Instead of a password management driver, you may provide a URL to which users are sent when they need help recovering their password. Any username in this url must be on the syntax foo={username} and {username} will be replaced with the real username.</msg>
<msg key="Change_password_URL">Change password URL</msg>
<msg key="Change_password_URL_help_text">Instead of a password management driver, you may provide a URL to which users are sent when they want to change their password. Any username in this url must be on the syntax foo={username} and {username} will be replaced with the real username.</msg>
<msg key="Account_Registration">Account registration</msg>
<msg key="Account_registration_URL">Account registration URL</msg>
<msg key="Account_reg_URL_help_text">URL where users register for a new account.</msg>
<msg key="On-Demand_Sync">On-Demand Sync</msg>
<msg key="User_Info">User Info</msg>
<msg key="User_Info_help_text">The implementation for getting user information from the authority in real-time</msg>
<msg key="Batch_sync_enabled">Batch sync enabled</msg>
<msg key="Yes">Yes</msg>
<msg key="No">No</msg>
<msg key="GetDocument_implementation">GetDocument implementation</msg>
<msg key="ProcessDocument_implementation">ProcessDocument implementation</msg>
<msg key="Start_time">Start time</msg>
<msg key="End_time">End time</msg>
<msg key="Run_time">Run time</msg>
<msg key="Actions">Actions</msg>
<msg key="Problems">Problems</msg>
<msg key="Actions_Minute">Actions/Minute</msg>
<msg key="Message">Message</msg>
<msg key="Interactive">Interactive</msg>
<msg key="Batch_Synchronization">Batch Synchronization</msg>
<msg key="Disable_this_authority">Disable this authority</msg>
<msg key="Enable_this_authority">Enable this authority</msg>
<msg key="Order">Order*</msg>
<msg key="Registration">Registration</msg>
<msg key="Make_this_the_authority_for_registering_new_users">Make this the authority for registering new users</msg>
<msg key="You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name">You are changing all user registrations to be in authority %authorities.pretty_name%</msg>
<msg key="Move_this_authority_up">Move this authority up</msg>
<msg key="Move_this_authority_down">Move this authority down</msg>
<msg key="Authentication">Authentication</msg>
<msg key="Password">Password</msg>
<msg key="Registration">Registration</msg>
<msg key="Are_you_sure_you_want_to_delete_authority_authorities_pretty_name">Are you sure you want to delete authority %authorities.pretty_name%?</msg>
<msg key="Delete">Delete</msg>
<msg key="One_batch_job">One batch job</msg>
<msg key="Authority_name">Authority name</msg>
<msg key="Start_time">Start time</msg>
<msg key="End_time">End time</msg>
<msg key="Running_time">Running time</msg>
<msg key="Snapshot">Snapshot</msg>
<msg key="Message">Message</msg>
<msg key="Creation_user">Creation user</msg>
<msg key="Document_start_time">Document start time</msg>
<msg key="Document_end_time">Document end time</msg>
<msg key="Document_status">Document status</msg>
<msg key="Document_message">Document message</msg>
<msg key="Document">Document</msg>
<msg key="Number_of_actions">Number of actions</msg>
<msg key="Number_of_problems">Number of problems</msg>
<msg key="download">download</msg>
<msg key="seconds">seconds</msg>
<msg key="Timestamp">Timestamp</msg>
<msg key="View_log_entry">View log entry</msg>
<msg key="Operation">Operation</msg>
<msg key="Username">Username</msg>
<msg key="Success">Success</msg>
</message_catalog>
<?xml version="1.0" encoding="ISO-8859-1"?>
<message_catalog package_key="acs-admin" package_version="5.3.0" locale="es_ES" charset="ISO-8859-1">
<msg key="Account_reg_URL_help_text">URL donde los usuarios pueden registrarse</msg>
<msg key="Account_Registration">Registro</msg>
<msg key="Account_registration_URL">URL de registro</msg>
<msg key="Actions">Acciones</msg>
<msg key="Actions_Minute">Acciones/mnuto</msg>
<msg key="Add_callback">Aadir un callback</msg>
<msg key="Administration">Administracin</msg>
<msg key="Are_you_sure_you_want_to_delete_authority_authorities_pretty_name">Desea realmente borrar la autoridad %authorities.pretty_name%?</msg>
<msg key="Authentication">Autenticacin</msg>
<msg key="Authority_name">Nombre de la autoridad</msg>
<msg key="Authority_short_name_help_text">Esto se usar al referirse a una autoridad en los parmetros. Aunque necesite cambiar el nombre mostrado arriba, esto no debera ser cambiado.</msg>
<msg key="Batch_sync_enabled">Sincronizacin batch habilitada</msg>
<msg key="Batch_Synchronization">Sincronizacin batch</msg>
<msg key="Change_password_URL">URL para cambiar la contrasea</msg>
<msg key="Change_password_URL_help_text">En lugar de un driver para la gestin de contrasea, puede especificar una URL donde los usuarios sern redirigidos para cambiar su contrasea. Los nombres de usuario pasados a esta URL deben tener la forma foo={username} donde {username} es el nombre del usuario.</msg>
<msg key="Creation_user">Creador</msg>
<msg key="Delete">Borrar</msg>
<msg key="Delete_callback">Borrar callback</msg>
<msg key="Disable_this_authority">Deshabilitar esta autoridad</msg>
<msg key="Document">Documento</msg>
<msg key="Document_end_time">Hora final del documento</msg>
<msg key="Document_message">Mensaje del documento</msg>
<msg key="Document_start_time">Hora inicial del documento</msg>
<msg key="Document_status">Estado del documento</msg>
<msg key="download">descarga</msg>
<msg key="Edit_callback">Editar callback</msg>
<msg key="Enable_this_authority">Habilitar esta autoridad</msg>
<msg key="Enabled">Habilitado</msg>
<msg key="End_time">Hora final</msg>
<msg key="General">General</msg>
<msg key="GetDocument_implementation">Implementacin para GetDocument</msg>
<msg key="Help_contact_help_text">Informacin de contacto (telfono, email, etc.) a mostrar cuando los usuarios tienen algn problema con la autoridad.</msg>
<msg key="Help_contact_text">Texto de ayuda</msg>
<msg key="Interactive">Interactivo</msg>
<msg key="Invoke">Invocar</msg>
<msg key="Invoke_this_callback_proc_now_Be_careful">Invocar este callback ahora. Tenga cuidado!</msg>
<msg key="Make_this_the_authority_for_registering_new_users">Establecer esta autoridad para los nuevos registros</msg>
<msg key="Message">Mensaje</msg>
<msg key="Move_this_authority_down">Mover esta autoridad haca abajo</msg>
<msg key="Move_this_authority_up">Mover esta autoridad haca arriba</msg>
<msg key="Name">Nombre</msg>
<msg key="No">No</msg>
<msg key="Number_of_actions">Nmero de acciones</msg>
<msg key="Number_of_problems">Nmero de problemas</msg>
<msg key="On-Demand_Sync">Sincronizacin bajo demanda</msg>
<msg key="One_batch_job">Un trabajo batch</msg>
<msg key="Operation">Operacin</msg>
<msg key="Order">Orden*</msg>
<msg key="Package_Manager">Package Manager</msg>
<msg key="Pages">Pginas</msg>
<msg key="Parameters">Parmetros</msg>
<msg key="Password">Contrasea</msg>
<msg key="Password_Management">Gestin de contrasea</msg>
<msg key="Problems">Problemas</msg>
<msg key="ProcessDocument_implementation">Implementacin para ProcessDocument</msg>
<msg key="Recover_password_URL">URL para recuperar contraseas</msg>
<msg key="Recover_password_URL_help_text">En lugar de un driver para la gestin de contrasea, puede especificar una URL donde los usuarios sern redirigidos para recuperar su contrasea. Los nombres de usuario pasados a esta URL deben tener la forma foo={username} donde {username} es el nombre del usuario.</msg>
<msg key="Registration">Registro</msg>
<msg key="Run_time">Tiempo de ejecucin</msg>
<msg key="Running_time">Running time</msg>
<msg key="seconds">segundos</msg>
<msg key="Service">Servicio</msg>
<msg key="Service_administration">Administracin de servicio</msg>
<msg key="Service_parameters">Parmetros del servicio</msg>
<msg key="Short_Name">Nombre corto</msg>
<msg key="Site-Wide_Admin">Site-Wide Admin</msg>
<msg key="Snapshot">Instantnea</msg>
<msg key="Start_time">Hora de inicio</msg>
<msg key="Success">Exito</msg>
<msg key="Tcl_Callbacks">Tcl Callbacks</msg>
<msg key="Tcl_Proc">Procedimiento Tcl</msg>
<msg key="Timestamp">Marca de tiempo</msg>
<msg key="Type">Tipo</msg>
<msg key="User_Info">Informacin de usuario</msg>
<msg key="User_Info_help_text">La implementacin para obtener la informacin de usuario desde la autoridad en tiempo real</msg>
<msg key="Username">Nombre de usuario</msg>
<msg key="View_log_entry">Ver log</msg>
<msg key="Visit_service_pages">Visitar pginas del servicio</msg>
<msg key="Yes">S</msg>
<msg key="You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name">Est cambiando todas las cuentas a la autoridad %authorities.pretty_name%</msg>
</message_catalog>
......@@ -40,32 +40,32 @@ template::list::create \
-multirow packages \
-elements {
instance_name {
label {Service}
label {#acs-admin.Service#}
}
www {
label "Pages"
label "\#acs-admin.Pages\#"
link_url_col url
link_html { title "Visit service pages" }
display_template {<if @packages.url@ not nil>Pages</if>}
link_html { title "\#acs-admin.Visit_service_pages\#" }
display_template {<if @packages.url@ not nil>\#acs-admin.Pages\#</if>}
}
admin {
label "Administration"
label "\#acs-admin.Administration\#"
link_url_col admin_url
link_html { title "Service administration" }
display_template {<if @packages.admin_url@ not nil>Administration</if>}
link_html { title "\#acs-admin.Service_administration\#" }
display_template {<if @packages.admin_url@ not nil>\#acs-admin.Administration\#</if>}
}
sitewide_admin {
label "Site-Wide Admin"
label "\#acs-admin.Site-Wide_Admin\#"
link_url_col sitewide_admin_url
link_html { title "Service administration" }
display_template {<if @packages.sitewide_admin_url@ not nil>Administration</if>}
link_html { title "\#acs-admin.Service_administration\#" }
display_template {<if @packages.sitewide_admin_url@ not nil>\#acs-admin.Administration\#</if>}
hide_p {[ad_decode $swadmin_p 1 0 1]}
}
parameters {
label "Parameters"
label "\#acs-admin.Parameters\#"
link_url_col param_url
link_html { title "Service parameters" }
display_template {<if @packages.param_url@ not nil>Parameters</if>}
link_html { title "\#acs-admin.Service_parameters\#" }
display_template {<if @packages.param_url@ not nil>\#acs-admin.Parameters\#</if>}
}
}
......@@ -56,6 +56,10 @@ ad_proc apm_header { { -form "" } args } {
lappend cmd $elem
}
set context_bar [eval $cmd]
# this is rather a hack, but just needed for streaming output
# a more general solution can be provided at some later time...
regsub "#acs-kernel.Main_Site#" $context_bar \
[_ acs-kernel.Main_Site] context_bar
}
set header [ad_header $title ""]
append body "$header\n"
......@@ -480,10 +484,14 @@ ad_proc -private apm_build_repository {
# The path to the 'packages' directory in the checkout
set packages_root_path [eval file join [lrange [file split $spec_file] 0 end-2]]
lappend cmd -C $packages_root_path
set tmp_filename [ns_tmpnam]
lappend cmd --files-from $tmp_filename -C $packages_root_path
set fp [open $tmp_filename w]
foreach file $files {
lappend cmd $package_key/$file
puts $fp $package_key/$file
}
close $fp
lappend cmd "|" [apm_gzip_cmd] -c ">" $apm_file
ns_log Notice "Executing: [ad_quotehtml $cmd]"
eval $cmd
......
ad_library {
Definitions of procs for the merge process
@creation-date 15 APR 2005
@author Enrique Catalan (quio@galileo.edu)
@cvs-id $Id$
}
namespace eval merge {}
ad_proc -public merge::MergeUserInfo {
-from_user_id:required
-to_user_id:required
} {
Merge user info. Revokes permissions for from_user_id and grants
them to to_user_id.
@param from_user_id From user ID.
@param to_user_id To user ID.
} {
ns_log Notice "Running merge::MergeUserInfo"
db_transaction {
if { ![db_0or1row to_user_portrait {*SQL*}] && [db_0or1row from_user_portrait {*SQL*}] } {
db_dml upd_portrait {*SQL*}
}
# get the permissions of the from_user_id
# and grant them to the to_user_id
db_foreach getfromobjs {*SQL*} {
# revoke the permissions of from_user_id
permission::revoke -object_id $from_oid -party_id $from_user_id -privilege $from_priv
if { ![db_string touserhas {*SQL*} ] } {
# grant the permissions to to_user_id
permission::grant -object_id $from_oid -party_id $to_user_id -privilege $from_priv
}
}
ns_log notice " Merging acs_objects"
db_dml acs_objs_upd {*SQL*}
}
ns_log Notice "Finishing merge::MergeUserInfo"
}
ad_proc -callback merge::MergePackageUser {
-from_user_id:required
-to_user_id:required
} {
Merge two accounts
} -
ad_proc -callback merge::MergeShowUserInfo {
-user_id:required
} {
Show information of accounts to merge
} -
<?xml version="1.0"?>
<queryset>
<fullquery name="merge::MergeUserInfo.to_user_portrait">
<querytext>
select c.item_id
from acs_rels a, cr_items c
where a.object_id_two = c.item_id
and a.object_id_one = :to_user_id
and a.rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
<fullquery name="merge::MergeUserInfo.from_user_portrait">
<querytext>
select c.item_id
from acs_rels a, cr_items c
where a.object_id_two = c.item_id
and a.object_id_one = :from_user_id
and a.rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
<fullquery name="merge::MergeUserInfo.upd_portrait">
<querytext>
update acs_rels
set object_id_one = :to_user_id
where object_id_one = :from_user_id
and rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
<fullquery name="merge::MergeUserInfo.getfromobjs">
<querytext>
select object_id as from_oid, privilege as from_priv from acs_permissions where grantee_id = :from_user_id
</querytext>
</fullquery>
<fullquery name="merge::MergeUserInfo.touserhas">
<querytext>
select count(*) from acs_permissions where object_id = :from_oid and grantee_id = :to_user_id
</querytext>
</fullquery>
<fullquery name="merge::MergeUserInfo.acs_objs_upd">
<querytext>
update acs_objects
set creation_user = :to_user_id
where creation_user = :from_user_id
</querytext>
</fullquery>
</queryset>
\ No newline at end of file
......@@ -12,8 +12,7 @@ ad_page_contract {
#----------------------------------------------------------------------
set cvs_command "cvs"
set cvs_root ":pserver:anonymous@openacs.org:/cvsroot"
set dotlrn_cvs_root ":pserver:anonymous@dotlrn.openacs.org:/dotlrn-cvsroot"
set cvs_root ":pserver:anonymous@cvs.openacs.org:/cvsroot"
set work_dir "[acs_root_dir]/repository-builder/"
......@@ -27,10 +26,10 @@ set index_template "/packages/acs-admin/www/apm/repository-index"
# from these packages
#set exclude_package_list { cms cms-news-demo glossary site-wide-search spam library }
set exclude_package_list {}
set head_channel "5-1"
set head_channel "5-3"
# Set this to 1 to only checkout sample packages -- useful for debugging and testing
set debug_p 1
set debug_p 0
#----------------------------------------------------------------------
# Prepare output
......@@ -49,8 +48,8 @@ ns_write <ul>
file mkdir $work_dir
cd $work_dir
catch { exec $cvs_command -d $cvs_root -z3 co openacs-4/readme.txt }
catch { exec $cvs_command -d $cvs_root -z3 co openacs-4/readme.txt }
catch { exec $cvs_command -d $cvs_root -z3 log -h openacs-4/readme.txt } output
set lines [split $output \n]
......@@ -108,8 +107,6 @@ foreach channel [lsort -decreasing [array names channel_tag]] {
# Wipe and re-create the checkout directory
file delete -force "${work_dir}openacs-4"
file delete -force "${work_dir}dotlrn"
file mkdir -force "${work_dir}dotlrn/packages"
# Prepare channel directory
set channel_dir "${work_dir}repository/${channel}/"
......@@ -129,8 +126,7 @@ foreach channel [lsort -decreasing [array names channel_tag]] {
# Full list for real use
set checkout_list [list \
$work_dir $cvs_root openacs-4/packages \
$work_dir $cvs_root openacs-4/contrib/packages \
${work_dir}dotlrn/packages/ $dotlrn_cvs_root dotlrn-core]
$work_dir $cvs_root openacs-4/contrib/packages]
}
foreach { cur_work_dir cur_cvs_root cur_module } $checkout_list {
......@@ -153,17 +149,18 @@ foreach channel [lsort -decreasing [array names channel_tag]] {
template::multirow create packages \
package_path package_key version pretty_name \
package_type summary description \
release_date vendor_url vendor
release_date vendor_url vendor \
license_url license maturity maturity_text
foreach packages_dir \
[list "${work_dir}openacs-4/packages" \
"${work_dir}openacs-4/contrib/packages" \
"${work_dir}dotlrn/packages"] {
"${work_dir}openacs-4/contrib/packages"] {
foreach spec_file [lsort [apm_scan_packages $packages_dir]] {
set package_path [eval file join [lrange [file split $spec_file] 0 end-1]]
set package_key [lindex [file split $spec_file] end-1]
set version_id [apm_version_id_from_package_key $package_key]
if { [lsearch -exact $exclude_package_list $package_key] != -1 } {
ns_write "Package $package_key is on list of packages to exclude - skipping"
......@@ -195,13 +192,21 @@ foreach channel [lsort -decreasing [array names channel_tag]] {
append manifest { } {<description format="} [ad_quotehtml $version(description.format)] {">}
append manifest [ad_quotehtml $version(description)] {</description>} \n
append manifest { } {<release-date>} [ad_quotehtml $version(release-date)] {</release-date>} \n
append manifest { } {<maturity>} [ad_quotehtml $version(maturity)] {</maturity>} \n
append manifest { } {<license url="} [ad_quotehtml $version(license_url)] {">}
append manifest [ad_quotehtml $version(license)] {</license>} \n
append manifest { } {<vendor url="} [ad_quotehtml $version(vendor.url)] {">}
append manifest [ad_quotehtml $version(vendor)] {</vendor>} \n
append manifest [apm::package_version::attributes::generate_xml \
-version_id $version_id \
-indentation { }]
template::multirow append packages \
$package_path $package_key $version(name) $version(package-name) \
$version(package.type) $version(summary) $version(description) \
$version(release-date) $version(vendor.url) $version(vendor)
$version(release-date) $version(vendor.url) $version(vendor) \
$version(license_url) $version(license) $version(maturity) [apm::package_version::attributes::maturity_int_to_text $version(maturity)]
set apm_file "${channel_dir}${version(package.key)}-${version(name)}.apm"
......@@ -219,13 +224,17 @@ foreach channel [lsort -decreasing [array names channel_tag]] {
# The path to the 'packages' directory in the checkout
set packages_root_path [eval file join [lrange [file split $spec_file] 0 end-2]]
lappend cmd -C $packages_root_path
set tmp_filename [ns_tmpnam]
lappend cmd --files-from $tmp_filename -C $packages_root_path
set fp [open $tmp_filename w]
foreach file $files {
lappend cmd $package_key/$file
puts $fp $package_key/$file
}
close $fp
lappend cmd "|" [apm_gzip_cmd] -c ">" $apm_file
ns_log Notice "Executing: [ad_quotehtml $cmd]"
#ns_log Notice "Executing: [ad_quotehtml $cmd]"
eval $cmd
}
......@@ -297,5 +306,3 @@ if { [file exists $repository_dirname] } {
file rename $work_repository_dirname $repository_dirname
ns_write "</ul> <h2>DONE</h2>\n"
......@@ -33,7 +33,7 @@ foreach version_id $install {
set ul_p 0
foreach file [apm_version_file_list -type data_model_create $version_id] {
foreach file [apm_get_package_files -package_key $package_key -file_type data_model_create] {
if { [string match *-drop.sql [file tail $file]] } {
continue
}
......@@ -50,7 +50,7 @@ foreach version_id $install {
ns_write "</pre></blockquote>\n"
}
foreach file [apm_version_file_list -type java_code $version_id] {
foreach file [apm_get_package_files -package_key $package_key -file_type java_code] {
if { !$ul_p } {
ns_write "<ul>\n"
set ul_p 1
......
......@@ -95,14 +95,20 @@ is already registerd to another package."
version_id {You must provide an integer key for your package version.}
}
# XXXJCD: this should be in the UI, along with license etc.
set attributes(maturity) 0
db_transaction {
# Register the package.
apm_package_register $package_key $pretty_name $pretty_plural $package_uri \
$package_type $initial_install_p $singleton_p
# Insert the version
set version_id [apm_package_install_version -callback apm_dummy_callback -version_id \
$version_id $package_key $version_name $version_uri $summary $description \
$description_format $vendor $vendor_uri $auto_mount]
set version_id [apm_package_install_version \
-callback apm_dummy_callback \
-version_id $version_id \
-array attributes \
$package_key $version_name $version_uri $summary $description \
$description_format $vendor $vendor_uri $auto_mount]
apm_version_enable -callback apm_dummy_callback $version_id
apm_package_install_owners -callback apm_dummy_callback \
[apm_package_install_owners_prepare $owner_name $owner_uri] $version_id
......
......@@ -6,7 +6,7 @@ ad_page_contract {
} {
}
set user_id [ad_verify_and_get_user_id]
set user_id [ad_conn user_id]
db_1row apm_get_name {
select first_names || ' ' || last_name user_name, email from cc_users where user_id = :user_id
......
......@@ -25,13 +25,9 @@ apm_version_info $version_id
doc_body_append [apm_header "Delete"]
db_transaction {
apm_package_delete -sql_drop_scripts $sql_drop_scripts -remove_files=0 -callback apm_doc_body_callback $package_key
} on_error {
if {[apm_package_registered_p $package_key] } {
doc_body_append "The database returned the following error
message <pre><blockquote>[ad_quotehtml $errmsg]</blockquote></pre>"
}
if { [catch {apm_package_delete -sql_drop_scripts $sql_drop_scripts -remove_files=0 -callback apm_doc_body_callback $package_key} errmsg] } {
doc_body_append "We encountered the following error when deleting package \"$package_key\":
<pre><blockquote>[ad_quotehtml $errmsg]</blockquote></pre>"
}
doc_body_append "
......
......@@ -57,7 +57,7 @@ if { [lindex $dependency_results 0] == 1 && [llength [lindex $dependency_results
set extra_package_keys [lindex $dependency_results 2]
# Check was good after adding a couple more pacakges
# Check was good after adding a couple more packages
doc_body_append "[apm_header "Package Installation"]
<h2>Additional Packages Automatically Added</h2><p>
......
......@@ -68,7 +68,7 @@ foreach pkg_info $pkg_install_list {
}
if { [empty_string_p $version(auto-mount)] && [string equal $version(package.type) apm_application] } {
set mount_html "<input type=\"checkbox\" name=\"mount_p\" value=\"$version(package.key)\" /> Mount package under the main site at path <input type=\"text\" name=\"mount_path.$version(package.key)\" value=\"$version(package.key)\" />"
set mount_html "<input type=\"checkbox\" name=\"mount_p\" value=\"$version(package.key)\" checked /> Mount package under the main site at path <input type=\"text\" name=\"mount_path.$version(package.key)\" value=\"$version(package.key)\" />"
} else {
set mount_html ""
}
......
<master>
<property name="title">@page_title;noquote@</property>
<property name="context">@context;noquote@</property>
<formtemplate id="del"></formtemplate>
......@@ -10,8 +10,6 @@ ad_page_contract {
version_id:naturalnum,notnull
}
apm_parameter_unregister $parameter_id
db_1row apm_package_by_version_id {
select pretty_name, version_name, package_key
from apm_package_version_info
......@@ -27,4 +25,31 @@ foreach section $sections {
}
}
ad_returnredirect [export_vars -base "version-parameters" { version_id section_name }]
set return_url [export_vars -base "version-parameters" { version_id section_name }]
ad_form -name del -form {
parameter_id:key
{confirm_p:text(hidden)}
{version_id:text(hidden)}
{section_name:text(hidden)}
{pretty_name:text(inform) {label "Package"}}
{parameter_name:text(inform) {label "Parameter"}}
} -edit_request {
set confirm_p 1
set parameter_name [db_string get_parameter_name {
select parameter_name
from apm_parameters
where parameter_id = :parameter_id
}]
} -edit_data {
#here's where we actually do the delete.
apm_parameter_unregister $parameter_id
} -after_submit {
ad_returnredirect $return_url
ad_script_abort
} -cancel_url $return_url
set page_title "Confirm Deletion"
set context [list [list "." "Package Manager"] [list [export_vars -base version-view { version_id }] "$pretty_name $version_name"] [list [export_vars -base version-parameters { version_id section_name }] "Parameters"] $page_title]
ad_return_template
......@@ -9,7 +9,7 @@ ad_page_contract {
}
set user_id [ad_verify_and_get_user_id]
set user_id [ad_conn user_id]
db_1row param_info {
select parameter_name, datatype, description, default_value, min_n_values, max_n_values, parameter_id,
......
......@@ -5,15 +5,24 @@ designated compatible with your OpenACS kernel will be shown.</p>
<table border="1" cellpadding="4" cellspacing="0">
<tr>
<th>Package</th>
<th>Status</th>
<th>Description</th>
<th>Release</th>
</tr>
<multiple name="packages">
<tr>
<td style="border-color:gray; text-align:center" valign="center" ><b>@packages.pretty_name@</b></td>
<td style="border-color:gray"><b>@packages.summary@</b><br>@packages.description;noquote@</td>
<td style="border-color:gray">@packages.package_key@ @packages.version@
<br> released @packages.release_date@ by @packages.vendor@</small></td>
<td style="border-color:gray; text-align:center" valign="center" >
<b>@packages.pretty_name@</b>
</td>
<td>
@packages.maturity@: @packages.maturity_text@<br>
<a href="@packages.license_url@">@packages.license@</a>
</td>
<td style="border-color:gray">
<b>@packages.summary@</b>
<br>@packages.description;noquote@
<br><small>@packages.package_key@ @packages.version@ released @packages.release_date@ by @packages.vendor@</small>
</td>
</tr>
</multiple>
</table>
......@@ -9,13 +9,13 @@ ad_page_contract {
db_1row package_version_info "select pretty_name, version_name from apm_package_version_info where version_id = :version_id"
set page_title "Tcl Callbacks"
set context [list [list "." "Package Manager"] [list [export_vars -base version-view { version_id }] "$pretty_name $version_name"] $page_title]
set page_title "\#acs-admin.Tcl_Callbacks\#"
set context [list [list "." "\#acs-admin.Package_Manager\#"] [list [export_vars -base version-view { version_id }] "$pretty_name $version_name"] $page_title]
set unused_callback_types [apm_unused_callback_types -version_id $version_id]
if { [llength $unused_callback_types] > 0 } {
set actions [list "Add callback" [export_vars -base "version-callback-add-edit" { version_id }]]
set actions [list "\#acs-admin.Add_callback\#" [export_vars -base "version-callback-add-edit" { version_id }]]
} else {
set actions [list]
}
......@@ -33,19 +33,19 @@ template::list::create \
<img src="/resources/acs-subsite/Edit16.gif" width="16" height="16" border="0">
}
link_url_eval {[export_vars -base "version-callback-add-edit" { version_id type }]}
link_html { title "Edit callback" }
link_html { title "\#acs-admin.Edit_callback\#" }
}
type {
label "Type"
label "\#acs-admin.Type\#"
}
proc {
label "Tcl Proc"
label "\#acs-admin.Tcl_Proc\#"
}
invoke {
label "Invoke"
display_template {<if @callbacks.type@ in "before-install" "after-install" "before-uninstall" "after-uninstall">Invoke</if><else><i style="color: gray;">N/A</i></else>}
label "\#acs-admin.Invoke\#"
display_template {<if @callbacks.type@ in "before-install" "after-install" "before-uninstall" "after-uninstall">\#acs-admin.Invoke\#</if><else><i style="color: gray;">N/A</i></else>}
link_url_eval {[ad_decode [lsearch { before-install after-install before-uninstall after-uninstall } $type] -1 {} [export_vars -base "version-callback-invoke" { version_id type }]]}
link_html { title "Invoke this callback proc now. Be careful!" }
link_html { title "\#acs-admin.Invoke_this_callback_proc_now_Be_careful\#" }
html { align center }
}
delete {
......@@ -55,7 +55,7 @@ template::list::create \
<img src="/resources/acs-subsite/Delete16.gif" width="16" height="16" border="0">
}
link_url_eval {[export_vars -base "version-callback-delete" { version_id type }]}
link_html { title "Delete callback" }
link_html { title "\#acs-admin.Delete_callback\#" }
}
}
......
......@@ -20,6 +20,25 @@ ad_page_contract {
{ upgrade_p 0 }
}
# Validate dynamic package version attributes
# Also put all dynamic attributes in an array
array set all_attributes [apm::package_version::attributes::get_spec]
foreach attribute_name [array names all_attributes] {
array set attribute $all_attributes($attribute_name)
set attribute_value [ns_set iget [rp_getform] $attribute_name]
if { [info exists attribute(validation_proc)] } {
set attribute_error [eval $attribute(validation_proc) $attribute_value]
if { ![empty_string_p $attribute_error] } {
ad_return_complaint 1 $attribute_error
}
}
set dynamic_attributes($attribute_name) $attribute_value
}
if {![regexp {^[0-9]+((\.[0-9]+)+((d|a|b|)[0-9]*)?)$} $version_name match]} {
ad_return_complaint 1 "The version name has invalid characters"
ad_script_abort
......@@ -48,7 +67,7 @@ if { $upgrade_p && [db_string apm_version_uri_unique_ck {
}
db_transaction {
set version_id [apm_version_update $version_id $version_name $version_uri \
set version_id [apm_version_update -array dynamic_attributes $version_id $version_name $version_uri \
$summary $description $description_format $vendor $vendor_uri $auto_mount $release_date]
apm_package_install_owners [apm_package_install_owners_prepare $owner_name $owner_uri] $version_id
apm_package_install_spec $version_id
......
......@@ -115,6 +115,31 @@ This description is <select name=description_format>
</tr>
"
# Dynamic package version attributes
array set all_attributes [apm::package_version::attributes::get_spec]
array set attributes [apm::package_version::attributes::get \
-version_id $version_id \
-array attributes]
foreach attribute_name [array names all_attributes] {
array set attribute $all_attributes($attribute_name)
if { [info exists attributes($attribute_name)] } {
# Attribute is already in db
set attribute_value $attributes($attribute_name)
} else {
# The attribute is not in the db yet
set attribute_value [apm::package_version::attributes::default_value $attribute_name]
}
doc_body_append "
<tr>
<th align=right nowrap>${attribute(pretty_name)}:</th>
<td><input name=\"$attribute_name\" size=\"30\" value=\"$attribute_value\">
</td>
</tr>
"
}
# Build a list of owners. Ensure that there are at least two.
set owners [db_list_of_lists apm_all_owners {
select owner_name, owner_uri from apm_package_owners where version_id = :version_id
......
......@@ -12,13 +12,11 @@ ad_page_contract {
{context_p 1}
}
db_1row apm_package_by_version_id {
select package_name, version_name, package_id from apm_package_version_info where version_id = :version_id
}
db_1row apm_package_by_version_id {}
set analyze_dir [ns_mktemp "[acs_root_dir]/apm-workspace/diffs-XXXXXX"]
doc_body_append "[apm_header "Create Diffs for $package_name $version_name"]
doc_body_append "[apm_header "Create Diffs for $pretty_name $version_name"]
<ul><li>Extracting the archive into $analyze_dir...<li>
"
......@@ -33,7 +31,7 @@ set no_changes [list]
global errorCode
foreach file [apm_version_file_list $version_id] {
foreach file [apm_get_package_files -package_key $package_key] {
if { ![file isfile "[acs_root_dir]/$file"] } {
doc_body_append "<h3>$file</h3>\n<blockquote>This file has been locally added.</blockquote>\n"
continue
......
......@@ -4,7 +4,7 @@
<fullquery name="apm_package_by_version_id">
<querytext>
select package_name, version_name, package_id from apm_package_version_info where version_id = :version_id
select package_key, pretty_name, version_name from apm_package_version_info where version_id = :version_id
</querytext>
</fullquery>
......
......@@ -102,7 +102,6 @@ if { [string equal $file_type adp] } {
-label $action_label \
-options {{{Find human language text and replace with <# ... #> tags} replace_text} {{Replace <# ... #> tags with #...# keys and insert message into catalog} replace_tags}} \
-values {replace_text} \
-section action_section
} else {
# TCL files or SQL files
element create file_list_form tcl_action_inform \
......
......@@ -152,7 +152,20 @@ append body "
<tr valign=baseline><th align=left>Package Key:</th><td>$package_key</td></th></tr>
<tr valign=baseline><th align=left>Summary:</th><td>$summary</td></tr>
<tr valign=baseline><th align=left>Description:</th><td>$description</td></tr>
<tr valign=baseline><th align=left>Release Date:</th><td>$release_date</td></tr>
<tr valign=baseline><th align=left>Release Date:</th><td>$release_date</td></tr>"
# Dynamic package version attributes
array set all_attributes [apm::package_version::attributes::get_spec]
array set attributes [apm::package_version::attributes::get \
-version_id $version_id \
-array attributes]
foreach attribute_name [array names attributes] {
array set attribute $all_attributes($attribute_name)
append body "<tr valign=baseline><th align=left>$attribute(pretty_name)</th><td>$attributes($attribute_name)</td></tr>"
}
append body "
<tr valign=baseline><th align=left>Vendor:</th><td>[ad_decode $vendor_uri "" $vendor "<a href=\"$vendor_uri\">$vendor</a>"]</td></tr>
<tr valign=baseline><th align=left>Package URL:</th><td><a href=\"$package_uri\">$package_uri</a></td></th></tr>
<tr valign=baseline><th align=left>Version URL:</th><td><a href=\"$version_uri\">$version_uri</a></td></th></tr>
......
......@@ -27,84 +27,90 @@ set form_widgets_full {
authority_id:key(acs_object_id_seq)
{-section "gen" {legendtext \#acs-admin.General\#}}
{pretty_name:text
{html {size 50}}
{label "Name"}
{section "General"}
{label "\#acs-admin.Name\#"}
}
{short_name:text,optional
{html {size 50}}
{label "Short Name"}
{label "\#acs-admin.Short_Name\#"}
{mode {[ad_decode $local_authority_p 1 "display" ""]}}
{help_text "This is used when referring to the authority in parameters etc. Even if you need to change the display name above, this should stay unchanged."}
{help_text "[_ acs-admin.Authority_short_name_help_text]"}
}
{enabled_p:text(radio)
{label "Enabled"}
{options {{Yes t} {No f}}}
{label "\#acs-admin.Enabled\#"}
{options {{[_ acs-admin.Yes] t} {[_ acs-admin.No] f}}}
}
{help_contact_text:richtext,optional
{html {cols 60 rows 13}}
{label "Help contact text"}
{help_text "Contact information (phone, email, etc.) to be displayed as a last resort when people are having problems with an authority."}
{label "\#acs-admin.Help_contact_text\#"}
{help_text "[_ acs-admin.Help_contact_help_text]"}
}
{-section "auth" {legendtext \#acs-admin.Authentication\#}}
{auth_impl_id:integer(select),optional
{label "Authentication"}
{section "Authentication"}
{label "\#acs-admin.Authentication\#"}
{options {[acs_sc::impl::get_options -empty_label "--Disabled--" -contract_name auth_authentication]}}
}
{-section "pwmngt" {legendtext \#acs-admin.Password_Management\#}}
{pwd_impl_id:integer(select),optional
{label "Password management"}
{section "Password Management"}
{label "\#acs-admin.Password_Management\#"}
{options {[acs_sc::impl::get_options -empty_label "--Disabled--" -contract_name auth_password]}}
}
{forgotten_pwd_url:text,optional
{html {size 50}}
{label "Recover password URL"}
{help_text "Instead of a password management driver, you may provide a URL to which users are sent when they need help recovering their password. Any username in this url must be on the syntax foo={username} and {username} will be replaced with the real username."}
{label "\#acs-admin.Recover_password_URL\#"}
{help_text "[_ acs-admin.Recover_password_URL_help_text]"}
}
{change_pwd_url:text,optional
{html {size 50}}
{label "Change password URL"}
{help_text "Instead of a password management driver, you may provide a URL to which users are sent when they want to change their password. Any username in this url must be on the syntax foo={username} and {username} will be replaced with the real username."}
{label "\#acs-admin.Change_password_URL\#"}
{help_text "[_ acs-admin.Change_password_URL_help_text]"}
}
{-section "accreg" {legendtext \#acs-admin.Account_Registration\#}}
{register_impl_id:integer(select),optional
{label "Account registration"}
{section "Account Registration"}
{label "\#acs-admin.Account_Registration\#"}
{options {[acs_sc::impl::get_options -empty_label "--Disabled--" -contract_name auth_registration]}}
}
{register_url:text,optional
{html {size 50}}
{label "Account registration URL"}
{help_text "URL where users register for a new account."}
{label "\#acs-admin.Account_registration_URL\#"}
{help_text "[_ acs-admin.Account_reg_URL_help_text]"}
}
{-section "ondemsyn" {legendtext \#acs-admin.On-Demand_Sync\#}}
{user_info_impl_id:integer(select),optional
{label "User Info"}
{section "On-Demand Sync"}
{label "\#acs-admin.User_Info\#"}
{options {[acs_sc::impl::get_options -empty_label "--Disabled--" -contract_name auth_user_info]}}
{help_text "The implementation for getting user information from the authority in real-time"}
{help_text "[_ acs-admin.User_Info_help_text]"}
}
{-section "batchsyn" {legendtext \#acs-admin.Batch_Synchronization\#}}
{batch_sync_enabled_p:text(radio)
{label "Batch sync enabled"}
{options {{Yes t} {No f}}}
{section {Batch Synchronization}}
{label "\#acs-admin.Batch_sync_enabled\#"}
{options {{[_ acs-admin.Yes] t} {[_ acs-admin.No] f}}}
}
{get_doc_impl_id:integer(select),optional
{label "GetDocument implementation"}
{label "\#acs-admin.GetDocument_implementation\#"}
{options {[acs_sc::impl::get_options -empty_label "--Disabled--" -contract_name auth_sync_retrieve]}}
}
{process_doc_impl_id:integer(select),optional
{label "ProcessDocument implementation"}
{label "\#acs-admin.ProcessDocument_implementation\#"}
{options {[acs_sc::impl::get_options -empty_label "--Disabled--" -contract_name auth_sync_process]}}
}
}
......@@ -218,33 +224,33 @@ list::create \
-key job_id \
-elements {
start_time_pretty {
label "Start time"
label "\#acs-admin.Start_time\#"
link_url_eval {$job_url}
}
end_time_pretty {
label "End time"
label "\#acs-admin.End_time\#"
}
run_time {
label "Run time"
label "\#acs-admin.Run_time\#"
html { align right }
}
num_actions {
label "Actions"
label "\#acs-admin.Actions\#"
html { align right }
}
num_problems {
label "Problems"
label "\#acs-admin.Problems\#"
html { align right }
}
actions_per_minute {
label "Actions/Minute"
label "\#acs-admin.Actions_Minute\#"
html { align right }
}
short_message {
label "Message"
label "\#acs-admin.Message\#"
}
interactive_pretty {
label "Interactive"
label "\#acs-admin.Interactive\#"
html { align center }
}
}
......
......@@ -11,9 +11,9 @@ ad_page_contract {
auth::sync::job::get -job_id $job_id -array batch_job
set page_title "One batch job"
set page_title "\#acs-admin.One_batch_job\#"
set context [list \
[list "." "Authentication"] \
[list "." "[_ acs-admin.Authentication]"] \
[list [export_vars -base authority { {authority_id $batch_job(authority_id)} }] "$batch_job(authority_pretty_name)"] $page_title]
ad_form \
......@@ -22,50 +22,50 @@ ad_form \
-display_buttons {} \
-form {
{authority_pretty_name:text(inform)
{label "Authority name"}
{label "\#acs-admin.Authority_name\#"}
}
{job_start_time:text(inform)
{label "Start time"}
{label "\#acs-admin.Start_time\#"}
}
{job_end_time:text(inform)
{label "End time"}
{label "\#acs-admin.End_time\#"}
}
{run_time_seconds:text(inform)
{label "Running time"}
{after_html " seconds"}
{label "\#acs-admin.Running_time\#"}
{after_html " [_ acs-admin.seconds]"}
}
{interactive_p:text(inform)
{label "Interactive"}
{label "\#acs-admin.Interactive\#"}
}
{snapshot_p:text(inform)
{label "Snapshot"}
{label "\#acs-admin.Snapshot\#"}
}
{message:text(inform)
{label "Message"}
{label "\#acs-admin.Message"}
}
{creation_user:text(inform)
{label "Creation user"}
{label "\#acs-admin.Creation_user\#"}
}
{doc_start_time:text(inform)
{label "Document start time"}
{label "\#acs-admin.Document_start_time\#"}
}
{doc_end_time:text(inform)
{label "Document end time"}
{label "\#acs-admin.Document_end_time\#"}
}
{doc_status:text(inform)
{label "Document status"}
{label "\#acs-admin.Document_status\#"}
}
{doc_message:text(inform)
{label "Document message"}
{label "\#acs-admin.Document_message\#"}
}
{document_download:text(inform)
{label "Document"}
{label "\#acs-admin.Document\#"}
}
{num_actions:text(inform)
{label "Number of actions"}
{label "\#acs-admin.Number_of_actions\#"}
}
{num_problems:text(inform)
{label "Number of problems"}
{label "\#acs-admin.Number_of_problems\#"}
}
} -on_request {
foreach element_name [array names batch_job] {
......@@ -82,7 +82,7 @@ ad_form \
set job_start_time [lc_time_fmt $batch_job(job_start_time) "%x %X"]
set job_end_time [lc_time_fmt $batch_job(job_end_time) "%x %X"]
set document_download "<a href=\"[export_vars -base batch-document-download { job_id }]\">download</a>"
set document_download "<a href=\"[export_vars -base batch-document-download { job_id }]\">[_ acs-admin.download]</a>"
}
list::create \
......@@ -93,37 +93,37 @@ list::create \
-page_query_name pagination \
-elements {
entry_time_pretty {
label "Timestamp"
label "\#acs-admin.Timestamp\#"
link_url_eval {$entry_url}
link_html { title "View log entry" }
link_html { title "\#acs-admin.View_log_entry\#" }
}
operation {
label "Operation"
label "\#acs-admin.Operation\#"
}
username {
label "Username"
label "\#acs-admin.Username\#"
link_url_col user_url
}
success_p {
label "Success"
label "\#acs-admin.Success\#"
display_template {
<if @batch_actions.success_p@ eq "t">
<font color="green">Yes</font>
<font color="green">\#acs-admin.Yes\#</font>
</if>
<else>
<font color="red">No</font>
<font color="red">\#acs-admin.No\#</font>
</else>
}
}
short_message {
label "Message"
label "\#acs-admin.Message\#"
}
} -filters {
job_id {
hide_p 1
}
success_p {
label "Success"
label "\#acs-admin.Success\#"
values {
{ Success t }
{ Failure f }
......
......@@ -24,37 +24,37 @@ list::create \
sub_class narrow
}
pretty_name {
label "Name"
label "\#acs-admin.Name\#"
link_url_eval {[export_vars -base authority { authority_id }]}
}
enabled {
label "Enabled"
label "\#acs-admin.Enabled\#"
html { align center }
display_template {
<if @authorities.enabled_p@ true>
<a href="@authorities.enabled_p_url@" title="Disable this authority"><img src="/shared/images/checkboxchecked" height="13" width="13" border="0" style="background-color: white;"></a>
<a href="@authorities.enabled_p_url@" title="\#acs-admin.Disable_this_authority\#"><img src="/shared/images/checkboxchecked" height="13" width="13" border="0" style="background-color: white;"></a>
</if>
<else>
<a href="@authorities.enabled_p_url@" title="Enable this authority"><img src="/shared/images/checkbox" height="13" width="13" border="0" style="background-color: white;"></a>
<a href="@authorities.enabled_p_url@" title="\#acs-admin.Enable_this_authority\#"><img src="/shared/images/checkbox" height="13" width="13" border="0" style="background-color: white;"></a>
</else>
}
}
move {
label "Order*"
label "\#acs-admin.Order\#"
html { align center }
display_template {
<if @authorities.sort_order@ ne @authorities.highest_sort_order@>
<a href="@authorities.sort_order_url_up@" title="Move this authority up"><img src="/resources/acs-subsite/arrow-up.gif" border="0" width="15" height="15"></a>
<a href="@authorities.sort_order_url_up@" title="\#acs-admin.Move_this_authority_up\#"><img src="/resources/acs-subsite/arrow-up.gif" border="0" width="15" height="15"></a>
</if>
<else><img src="/resources/acs-subsite/spacer.gif" width="15" height="15"></else>
<if @authorities.sort_order@ ne @authorities.lowest_sort_order@>
<a href="@authorities.sort_order_url_down@" title="Move this authority down"><img src="/resources/acs-subsite/arrow-down.gif" border="0" width="15" height="15"></a>
<a href="@authorities.sort_order_url_down@" title="\#acs-admin.Move_this_authority_down\#"><img src="/resources/acs-subsite/arrow-down.gif" border="0" width="15" height="15"></a>
</if>
<else><img src="/resources/acs-subsite/spacer.gif" width="15" height="15"></else>
}
}
registration {
label "Registration"
label "\#acs-admin.Registration\#"
html { align center }
display_template {
<switch @authorities.registration_status@>
......@@ -63,8 +63,8 @@ list::create \
</case>
<case value="can_select">
<a href="@authorities.registration_url@"
title="Make this the authority for registering new users"
onclick="return confirm('You are changing all user registrations to be in authority @authorities.pretty_name@');">
title="\#acs-admin.Make_this_the_authority_for_registering_new_users\#"
onclick="return confirm('\#acs-admin.You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name\#');">
<img src="/resources/acs-subsite/radio.gif" height="13" width="13" border="0" style="background-color: white;">
</a>
</case>
......@@ -75,13 +75,13 @@ list::create \
}
}
auth_impl {
label "Authentication"
label "\#acs-admin.Authentication\#"
}
pwd_impl {
label "Password"
label "\#acs-admin.Password\#"
}
reg_impl {
label "Registration"
label "\#acs-admin.Registration\#"
}
delete {
label ""
......@@ -89,8 +89,8 @@ list::create \
<if @authorities.short_name@ ne local>
<a href="@authorities.delete_url@"
title="Delete this authority"
onclick="return confirm('Are you sure you want to delete authority @authorities.pretty_name@?');">
<img src="/shared/images/Delete16.gif" height="16" width="16" alt="Delete" border="0">
onclick="return confirm('\#acs-admin.Are_you_sure_you_want_to_delete_authority_authorities_pretty_name\#');">
<img src="/shared/images/Delete16.gif" height="16" width="16" alt="\#acs-admin.Delete\#" border="0">
</a>
</if>
}
......
......@@ -35,7 +35,7 @@
</else>
<tr bgcolor="@bg@">
<td valign=top>@matches.key@</td>
<td valign=top>@matches.value@</td>
<td valign=top>@matches.value;noquote@</td>
<td valign=middle rowspan=2>
<form action=one method=post>
<input type=hidden name=key value="@matches.full_key@">
......
......@@ -32,7 +32,7 @@ foreach name $cached_names {
template::multirow append matches [string range $key 0 200] \
[string range $value 0 200] $value_size $safe_key \
$date $raw_date
}
}
}
}
......@@ -8,7 +8,7 @@
<th>Local Files</th>
</tr>
<tr>
<td>Download and install/upgrade automatically from <a href="http://openacs.org/repository">OpenACS.org repository</a>
<td>Download and install/upgrade automatically from <a href="http://openacs.org/repository/">OpenACS.org repository</a>
</td>
<td>
Install/upgrade from local files. Use this if your site has custom code or is in a local CVS repository. <a href="/doc/upgrade.html">Help</a>
......
......@@ -7,8 +7,10 @@ ad_page_contract {
if { ![empty_string_p $repository_url] } {
set parent_page_title "Install From OpenACS Repository"
set parent_page_url [export_vars -base install {repository_url}]
} else {
set parent_page_title "Install From Local File System"
set parent_page_url [export_vars -base install]
}
if { $success_p } {
......@@ -17,5 +19,5 @@ if { $success_p } {
set page_title "Installation Failed"
}
set context [list [list "." "Install Software"] [list "install" $parent_page_title] $page_title]
set context [list [list "." "Install Software"] [list $parent_page_url $parent_page_title] $page_title]
......@@ -8,9 +8,9 @@ ad_page_contract {
if { ![empty_string_p $repository_url] } {
set page_title "Install From OpenACS Repository"
set page_title "Install or Upgrade From OpenACS Repository"
} else {
set page_title "Install From Local File System"
set page_title "Install or Upgrade From Local File System"
}
set context [list [list "." "Install Software"] $page_title]
......@@ -37,6 +37,9 @@ foreach package_key [array names repository] {
# If in upgrade mode, only add to list if it's an upgrade
if { !$upgrade_p || [string equal $version(install_type) upgrade] } {
if {![exists_and_not_null version(maturity)]} {
set version(maturity) ""
}
set package([string toupper $version(package-name)]) \
[list \
$version(package.key) \
......@@ -44,7 +47,8 @@ foreach package_key [array names repository] {
$version(name) \
$version(package.type) \
$version(install_type) \
$version(summary)]
$version(summary) \
$version(maturity)]
}
}
}
......@@ -57,16 +61,28 @@ foreach package_key [array names repository] {
#####
# Sort the list alphabetically (in case package_name and package_key doesn't sort the same)
multirow create packages package_key package_name version_name package_type install_type summary
multirow create packages package_key package_name version_name package_type install_type summary maturity
if {[catch {set maturity_label [apm::package_version::attributes::get_pretty_name maturity]} errmsg]} {
set maturity_label "Maturity"
}
foreach name [lsort -ascii [array names package]] {
set row $package($name)
if {[info procs apm::package_version::attributes::maturity_int_to_text] != 0} {
set maturity_text "[apm::package_version::attributes::maturity_int_to_text [lindex $row 6]]"
} else {
set maturity_text ""
}
multirow append packages \
[lindex $row 0] \
[lindex $row 1] \
[lindex $row 2] \
[lindex $row 3] \
[lindex $row 4] \
[lindex $row 5]
[lindex $row 5] \
$maturity_text
}
multirow extend packages install_url
......@@ -81,7 +97,7 @@ template::list::create \
-multirow packages \
-key package_key \
-bulk_actions {
"Install checked applications" "install-2" "Install checked applications"
"Install or upgrade checked applications" "install-2" "Install or upgrade checked applications"
} \
-bulk_action_export_vars {
repository_url
......@@ -90,11 +106,14 @@ template::list::create \
package_name {
label "Package"
link_url_col install_url
link_html { title "Install this package" }
link_html { title "Install or upgrade this package" }
}
summary {
label "Summary"
}
maturity {
label "$maturity_label"
}
version_name {
label "Version"
}
......
/* ADP Reveal mode */
div.um-adp-box-off {
background-color: inherit;
border-width: 0px;
}
div.um-adp-output-off {
background-color: inherit;
border-width: 0px;
padding: 0px;
}
div.um-adp-box-off2 {
background-color: inherit;
border-width: 0px;
}
div.um-adp-output-off2 {
background-color: inherit;
border-width: 0px;
padding: 0px;
}
/* Developer-support footer */
.um-more-info {
clear: both;
padding: 6px;
border: none;
}
.um-more-info-off {
display: none;
}
.um-more-info2 {
clear: both;
padding: 6px;
border: none;
}
.um-more-info-off2 {
display: none;
}
\ No newline at end of file
......@@ -17,6 +17,7 @@
<li><a href="complex-search?target=one&only_authorized_p=0&only_needs_approval_p=1">Find all users needing approval</a></li>
<li><a href="user-add">Add a user</a></li>
<li><a href="/members/user-batch-add">Add a batch of users</a></li>
<li><a href="/admin/manage-email-privacy">#acs-subsite.manage_users_email#</a></li>
<form method='get' action='complex-search'>
<input type='hidden' name='target' value="one">
......
......@@ -92,7 +92,7 @@ if {[catch {
<pre>$errmsg</pre>"
}
set admin_user_id [ad_verify_and_get_user_id]
set admin_user_id [ad_conn user_id]
set email_from [db_string admin_email "select email from parties where party_id = :admin_user_id"]
set subject "$action"
set message $email_message
......
<master>
<property name=title>Merge account system</property>
<property name="context">@context;noquote@</property>
<h2>Confirm Merge</h2>
<center>
<p/>
<b>
The user @from_first_names@ @from_last_name@ (@from_email@) will be deleted.
<b/>
<p/>
<b style="color:red">
These accounts will be merged and the <u>good and final account</u> will be:
<p/>
<img border=2 width="80" height="80" src="@to_img_src@" alt="Portrait of @to_user_id@" />
<br/>
<span style="font-size:14pt;">@to_first_names@ @to_last_name@ (@to_email@)</span>
<p/>
</b>
<p/>
<b>WARNING:</b> Are you are absolutely sure to merge these accounts?
<p/>
<form action=merge-final method=get>
<table>
<tr>
<td>
<input type=radio name=merge_p value=1 />
</td>
<td>
Yes, I'm sure that I don't need the account @from_email@ anymore!.
</td>
</tr>
<tr>
<td>
<input checked=checked type=radio name=merge_p value=0 >
</td>
<td>
No, I'm not sure.
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=hidden name=from_user_id value="@from_user_id@">
<input type=hidden name=to_user_id value="@to_user_id@">
<input type=submit value="OK">
</td>
</tr>
</table>
</form>
</center>
\ No newline at end of file
ad_page_contract {
Merge two users accounts
TODO: Support to merge more than two accounts at the same time
@cvs-id $Id$
} {
to_user_id:integer
from_user_id:integer
merge_action
} -properties {
context:onevalue
} -validate {
if_diff_authority {
set from_authority_id [db_string gettoa "select authority_id from cc_users where user_id = :from_user_id"]
set to_authority_id [db_string getfroma "select authority_id from cc_users where user_id = :to_user_id"]
if { ![string equal $from_authority_id $to_authority_id] } {
ad_complain "Merge only works for users from the same authority"
}
}
}
if { [string equal $merge_action "0"] } {
set tempid $from_user_id
set from_user_id $to_user_id
set to_user_id $tempid
}
set current_user_id [ad_conn user_id]
set context [list [list "./" "Merge"] "Merge"]
# information of from_user_id
db_1row from_get_info { *SQL* }
# information of to_user_id
db_1row to_get_info { *SQL* }
# information of user_id one
if { [db_0or1row to_user_portrait { *SQL* }] } {
set to_img_src "[subsite::get_element -element url]shared/portrait-bits.tcl?user_id=$to_user_id"
} else {
set to_img_src "/resources/acs-admin/not_available.gif"
}
\ No newline at end of file
<?xml version="1.0"?>
<queryset>
<fullquery name="from_get_info">
<querytext>
select
first_names as from_first_names,
last_name as from_last_name,
email as from_email
from cc_users
where user_id = :from_user_id
</querytext>
</fullquery>
<fullquery name="to_get_info">
<querytext>
select
first_names as to_first_names,
last_name as to_last_name,
email as to_email
from cc_users
where user_id = :to_user_id
</querytext>
</fullquery>
<fullquery name="to_user_portrait">
<querytext>
select c.item_id
from acs_rels a, cr_items c
where a.object_id_two = c.item_id
and a.object_id_one = :to_user_id
and a.rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
</queryset>
<master>
<property name=title>Merging ... </property>
<property name="context">@context;noquote@</property>
<h2>Merging ...</h2>
<if @merge_p@ ne 0>
<p/>
@results;noquote@
<p/>
@msg@
</if>
ad_page_contract {
Merge two users accounts
TODO: Support to merge more than two accounts at the same time
@cvs-id $Id$
} {
to_user_id:integer
from_user_id:integer
merge_p
} -properties {
context:onevalue
} -validate {
if_diff_authority {
set from_authority_id [db_string gettoa "select authority_id from cc_users where user_id = :from_user_id"]
set to_authority_id [db_string getfroma "select authority_id from cc_users where user_id = :to_user_id"]
if { ![string equal $from_authority_id $to_authority_id] } {
ad_complain "Merge only works for users of the same authority"
}
}
if_the_logged_in_user_is_crazy {
# Just for security reasons...
set current_user_id [ad_conn user_id]
if { [string equal $current_user_id $to_user_id] || [string equal $current_user_id $from_user_id] } {
ad_complain "You can't merge yourself"
}
}
}
set context [list [list "./" "Merge"] "Merge"]
if { !$merge_p } {
ad_returnredirect "/acs-admin/users"
} else {
set final_results [callback merge::MergePackageUser -from_user_id $from_user_id -to_user_id $to_user_id]
set results "<ul>"
foreach item $final_results {
append results "<li>[lindex $item 0]<ul>"
for { set idx 1 } { $idx < [llength $item] } {incr idx} {
append results "<li>[lindex $item $idx] </li>"
}
append results "</ul></li>"
}
append results "</ul>"
merge::MergeUserInfo -from_user_id $from_user_id -to_user_id $to_user_id
set impl_id [auth::authority::get_element -authority_id $to_authority_id -element "auth_impl_id"]
set parameters [list $from_user_id $to_user_id $to_authority_id]
set user_res [acs_sc::invoke \
-error \
-contract "auth_authentication" \
-impl_id $impl_id \
-operation MergeUser \
-call_args $parameters]
# TODO: Add to the SC implementations of the SC
# an output to improve the msg's of the the final
# status of auth_authentication merge.
# It could be a list as we did with callbacks implementations.
# foreach item $user_res {
# append results "<li>[lindex $item 0]<ul>"
# for { set idx 1 } { $idx < [llength $item] } {incr idx} {
# append results "<li>[lindex $item $idx]</li>"
# }
# append results "</ul></li></ul>"
# }
# append results "</ul>"
set msg "Merge is done"
ns_log Notice $msg
}
<?xml version="1.0"?>
<queryset>
<rdbms><type>oracle</type><version>8.1.6</version></rdbms>
<fullquery name="one_user_contributions">
<querytext>
select
a.object_id,
at.pretty_name,
at.pretty_plural,
to_char(a.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date,
acs_object.name(a.object_id) as object_name
from acs_objects a, acs_object_types at
where a.object_type = at.object_type
and a.creation_user = :user_id
order by pretty_name,
creation_date desc,
object_name
</querytext>
</fullquery>
<fullquery name="two_user_contributions">
<querytext>
select
a.object_id,
at.pretty_name,
at.pretty_plural,
to_char(a.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date,
acs_object.name(a.object_id) as object_name
from acs_objects a, acs_object_types at
where a.object_type = at.object_type
and a.creation_user = :user_id_from_search
order by pretty_name,
creation_date desc,
object_name
</querytext>
</fullquery>
</queryset>
\ No newline at end of file
<?xml version="1.0"?>
<queryset>
<rdbms><type>postgresql</type><version>7.4</version></rdbms>
<fullquery name="one_user_contributions">
<querytext>
select
a.object_id,
at.pretty_name,
at.pretty_plural,
to_char(a.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date,
acs_object__name(a.object_id) as object_name
from acs_objects a, acs_object_types at
where a.object_type = at.object_type
and a.creation_user = :user_id
order by pretty_name,
creation_date desc,
object_name
</querytext>
</fullquery>
<fullquery name="two_user_contributions">
<querytext>
select
a.object_id,
at.pretty_name,
at.pretty_plural,
to_char(a.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date,
acs_object__name(a.object_id) as object_name
from acs_objects a, acs_object_types at
where a.object_type = at.object_type
and a.creation_user = :user_id_from_search
order by pretty_name,
creation_date desc,
object_name
</querytext>
</fullquery>
</queryset>
\ No newline at end of file
<master>
<property name="title">Merge account system</property>
<property name="context">@context;noquote@</property>
<property name="header_stuff">
<link rel="stylesheet" type="text/css" href="/resources/acs-admin/um-more-info.css" media="all">
</property>
<h2>User Account Merge</h2>
This is the user acccount merge wizard. You selected these accounts to merge:
<p/>
<table align="center">
<tr>
<td valign="top">
<table style="background-color:#006666;border-width:2px;">
<tr>
<td>
<table style="background-color:#D1FFFF">
<tr>
<td>
<center>
<b>ACCOUNT ONE</b>
<p/>
<img border="2" width="80" height="80" src="@one_img_src@" alt="Portrait of @user_id@" />
<h3>General Information of user one (<b>@one_email@</b>):</h3>
</center>
<ul>
<li>
Name:
<i>@one_first_names@ @one_last_name@</i>
</li>
<li>
Email:
<b><a href="mailto:@one_email@">@one_email@</a></b>
</li>
<li>
Scren name:
<b>@one_screen_name@</b>
</li>
<li>
Username:
<b>@one_username@</b>
</li>
<li>
User id:
@user_id@
</li>
<li>
URL:
@one_url@
</li>
<li>
Registration date:
@one_creation_date@
</li>
<li>
Registration IP:
@one_creation_ip@
</li>
<li>
Registration user:
@one_creation_user@
</li>
<li>
Last modified date:
@one_last_modified@
</li>
<li>
Modifying IP:
@one_modifying_ip@
</li>
<li>
Modifying user:
@one_modifying_user@
</li>
<li>
Last visit:
@one_last_visit@
</li>
<li>
Member state:
@one_member_state@
</li>
</ul>
<center>
(<a href="javascript:void(d=document);void(el=d.getElementsByTagName('div'));for(i=0;i&lt;el.length;i++){if(el[i].className=='um-more-info'){void(el[i].className='um-more-info-off')}else{if(el[i].className=='um-more-info-off'){void(el[i].className='um-more-info')}}};" class="off" title="Toggle Footer display">more information</a>)
</center>
<div class="um-adp-box-off">
<div class="um-more-info-off">
<multiple name="one_user_contributions">
<h2>@one_user_contributions.pretty_plural@</h2>
<ul>
<group column="pretty_name">
<li>@one_user_contributions.creation_date@: <a href="@one_user_contributions.one_item_object_url@" >@one_user_contributions.object_name@</a></li>
</group>
</ul>
</multiple>
@user_id_one_items_html;noquote@
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td valign="top">
<form action="merge-confirm" method="get">
<table>
<tr>
<td>
<center>
<b>Which is the good account?</b>
<p/>
<input type="radio" name="merge_action" value="0" />
<img src="/resources/acs-admin/left.gif" alt="left one" />
</center>
</td>
</tr>
<tr>
<td>
<center>
<input type="radio" name="merge_action" value="1" />
<img src="/resources/acs-admin/right.gif" alt="right one">
</center>
</td>
</tr>
<tr>
<td>
<input type="hidden" name="from_user_id" value="@user_id@" />
<input type="hidden" name="to_user_id" value="@user_id_from_search@" />
<center>
<input type="submit" value="Continue"/>
</center>
</td>
</tr>
</table>
</form>
</td>
<td valign="top">
<table style="background-color:#FFA217">
<tr>
<td>
<table style="background-color:#FFE3B9">
<tr>
<td>
<center>
<b>ACCOUNT TWO</b>
<p/>
<img border="2" width="80" height="80" src="@two_img_src@" alt="Portrait of @user_id_from_search@" />
<h3>General Information of user two (<b>@two_email@</b>):</h3>
</center>
<ul>
<li>
Name:
<i>@two_first_names@ @two_last_name@</i>
</li>
<li>
Email:
<b><a href="mailto:@two_email@">@two_email@</a></b>
</li>
<li>
Scren name:
<b>@two_screen_name@</b>
</li>
<li>
Username:
<b>@two_username@</b>
</li>
<li>
User id:
@user_id_from_search@
</li>
<li>
URL:
@two_url@
</li>
<li>
Registration date:
@two_creation_date@
</li>
<li>
Registration IP:
@two_creation_ip@
</li>
<li>
Registration user:
@two_creation_user@
</li>
<li>
Last modified date:
@two_last_modified@
</li>
<li>
Modifying IP:
@two_modifying_ip@
</li>
<li>
Modifying user:
@two_modifying_user@
</li>
<li>
Last visit:
@two_last_visit@
</li>
<li>
Member state:
@two_member_state@
</li>
</ul>
<center>
(<a href="javascript:void(d=document);void(el=d.getElementsByTagName('div'));for(i=0;i&lt;el.length;i++){if(el[i].className=='um-more-info2'){void(el[i].className='um-more-info-off2')}else{if(el[i].className=='um-more-info-off2'){void(el[i].className='um-more-info2')}}};" class="off" title="Toggle Footer display">more information</a>)
</center>
<div class="um-adp-box-off2">
<div class="um-more-info-off2">
<multiple name="two_user_contributions">
<h2>@two_user_contributions.pretty_plural@</h2>
<ul>
<group column="pretty_name">
<li>@two_user_contributions.creation_date@: <a href="@two_user_contributions.two_item_object_url@"> @two_user_contributions.object_name@ </a></li>
</group>
</ul>
</multiple>
@user_id_two_items_html;noquote@
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
ad_page_contract { #
Merge two users accounts
TODO: Support to merge more than two accounts at the same time
@cvs-id $Id$
} {
user_id
user_id_from_search
} -properties {
context:onevalue
first_names:onevalue
last_name:onevalue
} -validate {
if_the_logged_in_user_is_crazy {
# Just for security reasons...
set current_user_id [ad_conn user_id]
if { [string equal $current_user_id $user_id] || [string equal $current_user_id $user_id_from_search] } {
ad_complain "You can't merge yourself"
}
}
}
set context [list [list "./" "Merge"] "Merge"]
#
# Information of user_id_one
#
if { [db_0or1row one_user_portrait { *SQL* }] } {
set one_img_src "[subsite::get_element -element url]shared/portrait-bits.tcl?user_id=$user_id"
} else {
set one_img_src "/resources/acs-admin/not_available.gif"
}
db_1row one_get_info { *SQL* }
db_multirow -extend {one_item_object_url} one_user_contributions one_user_contributions { *SQL* } {
set one_item_object_url "[site_node::get_url_from_object_id -object_id $object_id]"
}
set user_id_one_items [callback merge::MergeShowUserInfo -user_id $user_id ]
if { ![empty_string_p $user_id_one_items] } {
set user_id_one_items_html "<ul><li><b>Packages User Information </b><ul>"
foreach pkg_list $user_id_one_items {
append user_id_one_items_html "<li><i>[lindex $pkg_list 0]</i><ul>"
set length [llength $pkg_list]
for { set idx 1} { $idx < $length } { incr idx } {
append user_id_one_items_html "<li>[lindex $pkg_list $idx]</li>"
}
append user_id_one_items_html "</ul></li>"
}
append user_id_one_items_html "</ul></li></ul>"
} else {
set user_id_one_items_html ""
}
#
# Information of user_id_two
#
if { [db_0or1row two_user_portrait { *SQL* }] } {
set two_img_src "[subsite::get_element -element url]shared/portrait-bits.tcl?user_id=$user_id_from_search"
} else {
set two_img_src "/resources/acs-admin/not_available.gif"
}
db_1row two_get_info { *SQL* }
db_multirow -extend {two_item_object_url} two_user_contributions two_user_contributions { *SQL* } {
set two_item_object_url "[site_node::get_url_from_object_id -object_id $object_id]"
}
set user_id_two_items [callback merge::MergeShowUserInfo -user_id $user_id_from_search ]
if { ![empty_string_p $user_id_two_items] } {
set user_id_two_items_html "<ul><li><b>Packages User Information </b><ul>"
foreach pkg_list $user_id_two_items {
append user_id_two_items_html "<li><i>[lindex $pkg_list 0]</i><ul>"
set length [llength $pkg_list]
for { set idx 1} { $idx < $length } { incr idx } {
append user_id_two_items_html "<li>[lindex $pkg_list $idx]</li>"
}
append user_id_two_items_html "</ul></li>"
}
append user_id_two_items_html "</ul></li></ul>"
} else {
set user_id_two_items_html ""
}
<?xml version="1.0"?>
<queryset>
<fullquery name="one_user_portrait">
<querytext>
select
c.item_id
from acs_rels a, cr_items c
where a.object_id_two = c.item_id
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
<fullquery name="one_get_info">
<querytext>
select
first_names as one_first_names,
last_name as one_last_name,
creation_user as one_creation_user,
to_char(creation_date,'month DD, yyyy') as one_creation_date,
creation_ip as one_creation_ip,
to_char(last_modified,'month DD, yyyy') as one_last_modified,
email as one_email,
url as one_url,
modifying_user as one_modifying_user,
modifying_ip as one_modifying_ip,
username as one_username,
screen_name as one_screen_name,
to_char(last_visit,'month DD, yyyy') as one_last_visit,
member_state as one_member_state
from cc_users
where user_id = :user_id
</querytext>
</fullquery>
<fullquery name="two_user_portrait">
<querytext>
select
c.item_id
from acs_rels a, cr_items c
where a.object_id_two = c.item_id
and a.object_id_one = :user_id_from_search
and a.rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
<fullquery name="two_get_info">
<querytext>
select
first_names as two_first_names,
last_name as two_last_name,
creation_user as two_creation_user,
to_char(creation_date,'month DD, yyyy') as two_creation_date,
creation_ip as two_creation_ip,
to_char(last_modified,'month DD, yyyy') as two_last_modified,
email as two_email,
url as two_url,
modifying_user as two_modifying_user,
modifying_ip as two_modifying_ip,
username as two_username,
screen_name as two_screen_name,
to_char(last_visit,'month DD, yyyy') as two_last_visit,
member_state as two_member_state
from cc_users
where user_id = :user_id_from_search
</querytext>
</fullquery>
</queryset>
......@@ -77,6 +77,17 @@ above.
<li><a href="modify-admin-privileges?user_id=@user_id@&action=grant">Grant site-wide administration privileges</a></li>
</else>
<li>Merge this user with:
<form method=get action=search>
<input type="hidden" name="target" value="merge" />
<input type="hidden" name="limit_to_user_id" value="@user_id@" />
<input type="hidden" name="from_user_id" value="@user_id@" />
<input type="hidden" name="only_authorized_p" value="0" />
<input type="text" size="15" name="keyword" />
<input type="submit" value="Find User" />
</form>
</li>
<if @password_reset_url@ not nil>
<li><a href="@password_reset_url@">Reset this user's password</a></li>
</if>
......
......@@ -13,6 +13,8 @@ ad_page_contract {
@param target URL to return to
@param passthrough Form variables to pass along from caller
@param limit_to_users_in_group_id Limits search to users in the specified group id. This can be a comma separated list to allow searches within multiple groups. (optional)
@param limit_to_user_id. This is useful is you don't want to show a list of user_ids. This could be a comma separated list. (optional)
@param from_user_id is used if you want to merge the user_id with user_id_from_search (optional)
@author Jin Choi (jsc@arsdigita.com)
} {
......@@ -23,6 +25,8 @@ ad_page_contract {
{passthrough ""}
{limit_users_in_group_id ""}
{only_authorized_p:integer 1}
{limit_to_user_id ""}
{from_user_id ""}
} -properties {
group_name:onevalue
search_type:onevalue
......@@ -102,6 +106,11 @@ if { ![info exists passthrough] } {
set passthrough_parameters "[export_entire_form_as_url_vars $passthrough]"
}
if { [exists_and_not_null limit_to_user_id ] } {
set limit_to_user_id [join $limit_to_user_id ","]
lappend where_clause "cc_users.user_id not in ($limit_to_user_id)"
}
if { [exists_and_not_null limit_to_users_in_group_id] } {
set query "select distinct first_names, last_name, email, member_state, email_verified_p, cu.user_id
from cc_users cu, group_member_map gm, membership_rels mr
......@@ -132,7 +141,12 @@ db_foreach user_search_admin $query {
set last_name_from_search $last_name
set email_from_search $email
set user_search:[set rowcount](user_id) $user_id
if { [empty_string_p $from_user_id] } {
set user_search:[set rowcount](user_id) $user_id
} else {
set user_search:[set rowcount](user_id) $from_user_id
}
set user_search:[set rowcount](first_names) $first_names
set user_search:[set rowcount](last_name) $last_name
set user_search:[set rowcount](email) $email
......
......@@ -17,7 +17,7 @@ ad_page_contract {
administration_name:onevalue
}
set admin_user_id [ad_verify_and_get_user_id]
set admin_user_id [ad_conn user_id]
# Get user info
acs_user::get -user_id $user_id -array user
......
......@@ -16,7 +16,7 @@ ad_page_contract {
export_vars:onevalue
}
set admin_user_id [ad_verify_and_get_user_id]
set admin_user_id [ad_conn user_id]
set context [list [list "./" "Users"] "New user notified"]
set export_vars [export_url_vars user_id]
......
<master>
<property name=title>Add a batch of users</property>
@success_text;noquote@
<hr/>
@exception_text;noquote@
ad_page_contract {
Interface for specifying a list of users to sign up as a batch
@cvs-id $Id$
} -query {
userlist
from
subject
message:allhtml
} -properties {
title:onevalue
success_text:onevalue
exception_text:onevalue
}
# parse the notify_ids arguments
# ...
set exception_text ""
set success_text ""
set title "Adding new users in bulk"
# parse the userlist input a row at a time
# most errors stop the processing of the line but keep going on the
# bigger block
while {[regexp {(.[^\n]+)} $userlist match_fodder row] } {
# remove each row as it's handled
set remove_count [string length $row]
set userlist [string range $userlist [expr $remove_count + 1] end]
set row [split $row ,]
set email [string trim [lindex $row 0]]
set first_names [string trim [lindex $row 1]]
set last_name [string trim [lindex $row 2]]
if {![info exists email] || ![util_email_valid_p $email]} {
append exception_text "<li>Couldn't find a valid email address in ($row).</li>\n"
continue
} else {
set email_count [db_string unused "select count(email)
from parties where email = lower(:email)"]
if {$email_count > 0} {
append exception_text "<li> $email was already in the database.</li>\n"
continue
}
}
if {![info exists first_names] || [empty_string_p $first_names]} {
append exception_text "<li> No first name in ($row)</li>\n"
continue
}
if {![info exists last_name] || [empty_string_p $last_name]} {
append exception_text "<li> No last name in ($row)</li>\n"
continue
}
# We've checked everything.
set password [ad_generate_random_string]
array set auth_status_array [auth::create_user -email $email -first_names $first_names -last_name $last_name -password $password]
set user_id $auth_status_array(user_id)
append success_text "Created user $user_id for ($row)<br\>"
# if anything goes wrong here, stop the whole process
if { !$user_id } {
ad_return_error "Insert Failed" "We were unable to create a user record for ($row)."
ad_script_abort
}
# send email
set key_list [list first_names last_name email password]
set value_list [list $first_names $last_name $email $password]
set sub_message $message
foreach key $key_list value $value_list {
regsub -all "<$key>" $sub_message $value sub_message
}
if {[catch {ns_sendmail "$email" "$from" "$subject" "$sub_message"} errmsg]} {
ad_return_error "Mail Failed" "The system was unable to send email. Please notify the user personally. This problem is probably caused by a misconfiguration of your email system. Here is the error:
<blockquote><pre>
[ad_quotehtml $errmsg]
</pre></blockquote>"
return
}
}
ad_return_template
<master>
<property name=title>Add a batch of users</property>
<property name="context">@context;noquote@</property>
<form method="post" action="user-batch-add-2">
<p>Add these users to @system_name@, one user per line.</p>
<br /><textarea name=userlist rows=15 cols=50>
email, first name, last name
</textarea>
<p>Each user will get this email:
<br />From: <input name="from" value="@admin_email@">
<br />Subject: <input name=subject value="You have been added as a user to @system_name@ at @system_url@" size=50>
<p>Message:
<br /><textarea name="message" rows=10 cols=70 wrap=hard>
Dear &lt;first_names&gt; &lt;last_name&gt;,
You have been added as a user to @system_name@
at @system_url@
Login information:
Email: &lt;email&gt;
Password: &lt;password&gt;
(you may change your password after you log in)
Thank you,
@administration_name@
</textarea>
</p>
<center>
<input type="submit" value="Import List and Send Emails" />
</center>
</form>
</p>
ad_page_contract {
Interface for specifying a list of users to sign up as a batch
@cvs-id $Id$
} -properties {
context:onevalue
system_name:onevalue
system_url:onevalue
administration_name:onevalue
admin_email:onevalue
}
set admin_user_id [ad_conn user_id]
set admin_email [db_string unused "select email from
parties where party_id = :admin_user_id"]
set administration_name [db_string admin_name "select
first_names || ' ' || last_name from persons where person_id = :admin_user_id"]
set context [list [list "./" "Users"] "Notify added user"]
set system_name [ad_system_name]
set export_vars [export_form_vars email first_names last_name user_id]
set system_url [ad_parameter -package_id [ad_acs_kernel_id] SystemURL ""].
ad_return_template
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment