Commit f94bfce9 authored by Malte Sussdorff's avatar Malte Sussdorff

New version of acs-admin

parent 8dd57088
......@@ -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>
......
......@@ -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
......
......@@ -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 ""
}
......
......@@ -22,7 +22,6 @@ ns_write "[apm_header "Package Installation"]
<ul>
"
# We have a set of SQL files that need to be sourced at the appropriate time.
set sql_files [list]
foreach index $sql_file {
......@@ -32,7 +31,6 @@ foreach index $sql_file {
set installed_count 0
foreach pkg_info $pkg_install_list {
set spec_file [pkg_info_spec $pkg_info]
set package_path [pkg_info_path $pkg_info]
......@@ -73,9 +71,6 @@ foreach pkg_info $pkg_install_list {
set enable_p [expr [lsearch -exact $pkg_enable_list $package_key] != -1]
# ad_return_complaint 1 "apm_package_install -enable=$enable_p -package_path $package_path -callback apm_ns_write_callback -load_data_model -data_model_files $data_model_files -mount_path $selected_mount_path $spec_file"
set version_id [apm_package_install \
-enable=$enable_p \
-package_path $package_path \
......
......@@ -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"
}
......
......@@ -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
......
......@@ -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]
......
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