Commit 4e0d251a authored by Frank Bergmann's avatar Frank Bergmann

- Updated to OpenACS 5.9.1

parent d9dba54b
......@@ -9,10 +9,10 @@
<implements-subsite-p>f</implements-subsite-p>
<inherit-templates-p>t</inherit-templates-p>
<version name="5.9.0" url="http://openacs.org/repository/download/apm/acs-admin-5.9.0.apm">
<version name="5.9.1" url="http://openacs.org/repository/download/apm/acs-admin-5.9.1.apm">
<owner url="mailto:dhogaza@pacifier.com">Don Baccus</owner>
<summary>An interface for Site-wide administration of an OpenACS Installation.</summary>
<release-date>2015-10-04</release-date>
<release-date>2017-08-06</release-date>
<vendor url="http://openacs.org">OpenACS</vendor>
<description format="text/html">Provides a UI for administering site-wide services
(including package installation, cache, authentication, and user accounts) for an OpenACS system.
......@@ -20,10 +20,12 @@
<license>GPL</license>
<maturity>3</maturity>
<provides url="acs-admin" version="5.9.0"/>
<requires url="acs-kernel" version="5.9.0"/>
<requires url="acs-mail-lite" version="5.9.0"/>
<provides url="acs-admin" version="5.9.1"/>
<requires url="acs-kernel" version="5.9.1"/>
<requires url="acs-tcl" version="5.9.1"/>
<requires url="acs-templating" version="5.9.1"/>
<requires url="acs-mail-lite" version="5.9.1"/>
<callbacks>
</callbacks>
<parameters>
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<message_catalog package_key="acs-admin" locale="de_DE" charset="ISO-8859-1">
<msg key="Account_reg_URL_help_text">URL fr Benutzer zum registrieren eines neuen Kontos.</msg>
<msg key="Account_Registration">Konto Registrierung</msg>
<msg key="Account_registration_URL">URL zum registrieren eines Kontos</msg>
<msg key="Account_reg_URL_help_text">URL wo sich Benutzer fr ein neues Konto registrieren knnen</msg>
<msg key="Account_Registration">Registrierung von Benutzenkonten</msg>
<msg key="Account_registration_URL">URL zur Registrierung von Benutzerkonten</msg>
<msg key="Actions">Aktionen</msg>
<msg key="Authentication">Authentifizierung</msg>
<msg key="Authority_name">Domnenname</msg>
<msg key="Disable_this_authority">Diese Domne deaktivieren</msg>
<msg key="Enable_this_authority">Diese Domne aktivieren</msg>
<msg key="Enabled">Aktiv</msg>
<msg key="Help_contact_help_text">Kontaktinformationen (Telefon, Email, etc.) die angezeigt werden, wenn ein Benutzer Probleme mit der Anmeldung an dieser Domne hat.</msg>
<msg key="Make_this_the_authority_for_registering_new_users">Dies zur Domne fr die Registrierung neuer Benutzer machen</msg>
<msg key="Move_this_authority_down">Diese Domne nach unten bewegen</msg>
<msg key="Move_this_authority_up">Diese Domne nach oben bewegen</msg>
<msg key="Actions_Minute">Aktionen/Minute</msg>
<msg key="Add_callback">Callback hinzufgen</msg>
<msg key="Administration">Administration</msg>
<msg key="Are_you_sure_you_want_to_delete_authority_authorities_pretty_name">Sind Sie sicher, dass Sie Autoritt %authorities.pretty_name% lschen mchten?</msg>
<msg key="Authentication">Authentifikation</msg>
<msg key="Authority_name">Name der Autoritt</msg>
<msg key="Authority_short_name_help_text">Wird benutzt um die Autoritt zu referenzieren. Auch wenn Sie den Anzeigenamen ndern, sollte dies unverndert bleiben.</msg>
<msg key="Batch_sync_enabled">Batch sync aktiviert</msg>
<msg key="Batch_Synchronization">Batch Synchronisation</msg>
<msg key="Change_password_URL">URL zum ndern des Passwortes</msg>
<msg key="Change_password_URL_help_text">Anstatt des Password Management Treibers knnen Sie eine URL angeben zu welcher Benutzer weitergeleitet werden wenn sie ihr Passwort ndern mchten. Benutzernamen in dieser URL mssen dem Syntax foo={username} entsprechen, {username} wird durch den Benutzernamen ersetzt.</msg>
<msg key="Creation_user">Anlegender Benutzer</msg>
<msg key="Delete">Lschen</msg>
<msg key="Delete_callback">Callback lschen</msg>
<msg key="Disable_this_authority">Diese Autoritt deaktivieren</msg>
<msg key="Document">Dokument</msg>
<msg key="Document_end_time">Dokument Endzeit</msg>
<msg key="Document_message">Dokument Nachricht</msg>
<msg key="Document_start_time">Dokument Startzeit</msg>
<msg key="Document_status">Dokument Status</msg>
<msg key="download">Download</msg>
<msg key="Edit_callback">Callback bearbeiten</msg>
<msg key="Enable_this_authority">Diese Autoritt aktivieren</msg>
<msg key="Enabled">Aktiviert</msg>
<msg key="End_time">Endzeit</msg>
<msg key="General">Allgemein</msg>
<msg key="GetDocument_implementation">GetDocument Implementierung</msg>
<msg key="Help_contact_help_text">Kontaktinformation (Telefon, E-Mail, etc.) als letztes Mittel wenn Benutzer Probleme mit einer Autoritt haben.</msg>
<msg key="Help_contact_text">Hilfetext Kontakt</msg>
<msg key="Interactive">Interaktiv</msg>
<msg key="Invoke">Aufrufen</msg>
<msg key="Invoke_this_callback_proc_now_Be_careful">Diesen Callback jetzt aufrufen. Vorsicht!</msg>
<msg key="Make_this_the_authority_for_registering_new_users">Zur Autoritt fr die Registrierung von neuen Benutzern machen</msg>
<msg key="Message">Nachricht</msg>
<msg key="Move_this_authority_down">Diese Autoritt nach unten bewegen</msg>
<msg key="Move_this_authority_up">Diese Autoritt nach oben bewegen</msg>
<msg key="Name">Name</msg>
<msg key="No">Nein</msg>
<msg key="Order">Ordnung</msg>
<msg key="Number_of_actions">Anzahl der Aktionen</msg>
<msg key="Number_of_problems">Anzahl der Probleme</msg>
<msg key="On-Demand_Sync">Sync auf Anforderung</msg>
<msg key="One_batch_job">Ein Batch-Job</msg>
<msg key="Operation">Operation</msg>
<msg key="Order">Reihenfolge</msg>
<msg key="Package_Manager">Package Manager</msg>
<msg key="Pages">Seiten</msg>
<msg key="Parameters">Parameter</msg>
<msg key="Password">Passwort</msg>
<msg key="Password_Management">Passwort-Management</msg>
<msg key="Problems">Probleme</msg>
<msg key="ProcessDocument_implementation">ProcessDocument-Implementierung</msg>
<msg key="Recover_password_URL">Passwort verloren URL</msg>
<msg key="Recover_password_URL_help_text">Statt eines Passwort Management Treibers, knnen Sie eine URL angeben zu welcher Benutzer weitergeleitet werden, wenn Sie Hilfe bei der Wiederherstellung ihres Passwortes bentigen. Benutzernamen in dieser URL mssen dem Syntax foo={username} entsprechen, {username} wird durch den Benutzernamen ersetzt.</msg>
<msg key="Registration">Registrierung</msg>
<msg key="Run_time">Laufzeit</msg>
<msg key="Running_time">Laufzeit</msg>
<msg key="seconds">Sekunden</msg>
<msg key="Service">Service</msg>
<msg key="Service_administration">Service-Verwaltung</msg>
<msg key="Service_parameters">Service-Parameter</msg>
<msg key="Short_Name">Kurzbezeichnung</msg>
<msg key="Site-Wide_Admin">Globaler Administrator</msg>
<msg key="Snapshot">Schnappschuss</msg>
<msg key="Start_time">Startzeit</msg>
<msg key="Success">Erfolgreich</msg>
<msg key="Tcl_Callbacks">Tcl Callbacks</msg>
<msg key="Tcl_Proc">Tcl Proc</msg>
<msg key="Timestamp">Zeitstempel</msg>
<msg key="Type">Typ</msg>
<msg key="User_Info_help_text">Die Implementierung um Benutzerinformationen in Echtzeit von der Domne zu holen</msg>
<msg key="User_Info">Benutzerinformationen</msg>
<msg key="User_Info_help_text">Die Implementierung, um Benutzerinformationen in Echtzeit von der Autoritt zu bekommen</msg>
<msg key="Username">Benutzername</msg>
<msg key="View_log_entry">Log-Entrag zeigen</msg>
<msg key="Visit_service_pages">Service-Seiten besuchen</msg>
<msg key="Yes">Ja</msg>
<msg key="You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name">Sie weisen alle Benutzer der Domne %authorities.pretty_name% zu</msg>
<msg key="You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name">Sie ndern die Autoritt fr alle Registrierungen in %authorities.pretty_name%</msg>
</message_catalog>
<?xml version="1.0" encoding="ISO-8859-1"?>
<message_catalog package_key="acs-admin" locale="it_IT" charset="ISO-8859-1">
<msg key="Account_reg_URL_help_text">URL da cui gli utenti possono registrare un nuovo account.</msg>
<msg key="Account_reg_URL_help_text">URL dove gli utenti si registrano per un nuovo account</msg>
<msg key="Account_Registration">Registrazione account</msg>
<msg key="Account_registration_URL">URL registrazione account</msg>
<msg key="Account_registration_URL">URL di registrazione account</msg>
<msg key="Actions">Azioni</msg>
<msg key="Actions_Minute">Azioni/Minuto</msg>
<msg key="Add_callback">Aggiungi callback</msg>
<msg key="Administration">Gestione</msg>
<msg key="Are_you_sure_you_want_to_delete_authority_authorities_pretty_name">Eliminare autorit %authorities.pretty_name%?</msg>
<msg key="Authentication">Autentificazione</msg>
<msg key="Authority_name">Nome autorit</msg>
<msg key="Authority_short_name_help_text">Si usa come riferimento all&#39;autorit nei parametri, ecc. Deve rimanere inalterato anche in caso di modifica al nome visualizzato.</msg>
<msg key="Batch_sync_enabled">Sincronizzazione in batch abilitata</msg>
<msg key="Batch_Synchronization">Sincronizzazione in batch</msg>
<msg key="Change_password_URL">URL modifica password</msg>
<msg key="Change_password_URL_help_text">Invece di un drivere per la gestione della password, si fornisce un URL in cui vengono inviati quegli utenti che desiderano modificare la password. Tutti i nomi utente in questo URL devono essere scritti come foo={username} dove {username} verr sostituito dal nome utente reale.</msg>
<msg key="Creation_user">Creazione utente</msg>
<msg key="Administration">Amministrazione</msg>
<msg key="Are_you_sure_you_want_to_delete_authority_authorities_pretty_name">Sei sicuro/a di voler eliminare l&#39;authority %authorities.pretty_name%?</msg>
<msg key="Authentication">Autenticazione</msg>
<msg key="Authority_name">Nome authority</msg>
<msg key="Authority_short_name_help_text">Questo viene usato quando ci si riferisce all&#39;authority nei parametri ecc. Anche se dovessi cambiare il nome visualizzato sopra, questo dovrebbe rimanere immutato.</msg>
<msg key="Batch_sync_enabled">Sincronizzazione batch abilitata</msg>
<msg key="Batch_Synchronization">Sincronizzazione batch</msg>
<msg key="Change_password_URL">URL di modifica password</msg>
<msg key="Change_password_URL_help_text">Al posto di un driver per la gestione delle password, puoi fornire un URL verso il quale gli utenti saranno reindirizzati quando volessero cambiare la loro password. Qualsiasi username in questo URL deve essere nella forma foo={username} and {username} sar sostituito con il vero username.</msg>
<msg key="Creation_user">Utente creazione</msg>
<msg key="Delete">Elimina</msg>
<msg key="Delete_callback">Elimina callback</msg>
<msg key="Disable_this_authority">Disabilita la presente autorit</msg>
<msg key="Delete_callback">Callback di eliminazione</msg>
<msg key="Disable_this_authority">Disabilita questa authority</msg>
<msg key="Document">Documento</msg>
<msg key="Document_end_time">Ora finale del documento</msg>
<msg key="Document_message">Messaggio del documento</msg>
<msg key="Document_start_time">Ora iniziale del documento</msg>
<msg key="Document_status">Stato del documento</msg>
<msg key="Document_end_time">Ora fine documento</msg>
<msg key="Document_message">Messaggio documento</msg>
<msg key="Document_start_time">Ora inizio documento</msg>
<msg key="Document_status">Status documento</msg>
<msg key="download">scarica</msg>
<msg key="Edit_callback">Modifica callback</msg>
<msg key="Enable_this_authority">Abilita quest&#39;autorit</msg>
<msg key="Enabled">Abilitato</msg>
<msg key="End_time">Ora finale</msg>
<msg key="Edit_callback">Callback di modifica</msg>
<msg key="Enable_this_authority">Abilita questa authority</msg>
<msg key="Enabled">Abilitato/a</msg>
<msg key="End_time">Ora fine</msg>
<msg key="General">Generale</msg>
<msg key="GetDocument_implementation">Implementazione GetDocument</msg>
<msg key="Help_contact_help_text">Dati di contatto (telefono, e-mail, ecc.) da mostrare come ultima risorsa quando si presenta un problema con un&#39;autorit.</msg>
<msg key="Help_contact_text">Testo aiuto contatto </msg>
<msg key="Interactive">Interattivo</msg>
<msg key="Invoke">Invocare</msg>
<msg key="Invoke_this_callback_proc_now_Be_careful">Invocare ora questa procedura di callback. Attenzione!</msg>
<msg key="Make_this_the_authority_for_registering_new_users">Rendere quest&#39;autorit quella che registra i nuovi utenti</msg>
<msg key="Help_contact_help_text">Informazioni di contatto (telefono, email, ecc.) da mostrare come ultima risorsa nel caso le persone avessero problemi con una authority.</msg>
<msg key="Help_contact_text">Contatto di emergenza</msg>
<msg key="Interactive">Interattivo/a</msg>
<msg key="Invoke">Invoca</msg>
<msg key="Invoke_this_callback_proc_now_Be_careful">Invoca ora questa callback. Fai attenzione!</msg>
<msg key="Make_this_the_authority_for_registering_new_users">Rendi questa l&#39;authority per la registrazione di nuovi utenti</msg>
<msg key="Message">Messaggio</msg>
<msg key="Move_this_authority_down">Sposta in basso la presente autorit</msg>
<msg key="Move_this_authority_up">Sposta in alto la presente autorit</msg>
<msg key="Move_this_authority_down">Sposta questa authority in basso</msg>
<msg key="Move_this_authority_up">Sposta questa authority in alto</msg>
<msg key="Name">Nome</msg>
<msg key="No">No</msg>
<msg key="Number_of_actions">Numero di azioni</msg>
<msg key="Number_of_problems">Numero di problemi</msg>
<msg key="On-Demand_Sync">Sincronizzazione su richiesta</msg>
<msg key="One_batch_job">Un lavoro in batch</msg>
<msg key="On-Demand_Sync">Sincronizzazione On-Demand</msg>
<msg key="One_batch_job">Un processo batch</msg>
<msg key="Operation">Operazione</msg>
<msg key="Order">Ordine*</msg>
<msg key="Package_Manager">Package Manager</msg>
<msg key="Package_Manager">Gestore dei Pacchetti</msg>
<msg key="Pages">Pagine</msg>
<msg key="Parameters">Parametri</msg>
<msg key="Password">Password</msg>
<msg key="Password_Management">Gestione password</msg>
<msg key="Password_Management">Gestione Password</msg>
<msg key="Problems">Problemi</msg>
<msg key="ProcessDocument_implementation">Implementazione ProcessDocument</msg>
<msg key="Recover_password_URL">URL per il recupero password</msg>
<msg key="Recover_password_URL_help_text">Invece di un drivere per la gestione della password, si fornisce un URL in cui vengono inviati quegli utenti che desiderano recuperare la password. Tutti i nomi utente in questo URL devono essere scritti come foo={username} dove {username} verr sostituito dal nome utente reale.</msg>
<msg key="Registration">Registrazioine</msg>
<msg key="Run_time">Tempo d&#39;esecuzione</msg>
<msg key="Running_time">Tempo d&#39;esecuzione</msg>
<msg key="Recover_password_URL">URL di recupero password</msg>
<msg key="Recover_password_URL_help_text">Al posto di un driver per la gestione delle password, puoi fornire un URL verso il quale gli utenti saranno reindirizzati quando volessero recuperare la loro password. Qualsiasi username in questo URL deve essere nella forma foo={username} e {username} sar sostituito con il vero username.</msg>
<msg key="Registration">Registrazione</msg>
<msg key="Run_time">Tempo esecuzione</msg>
<msg key="Running_time">Tempo di esecuzione</msg>
<msg key="seconds">secondi</msg>
<msg key="Service">Servizio</msg>
<msg key="Service_administration">Gestione servizio</msg>
<msg key="Service_parameters">Parametri di servizio</msg>
<msg key="Short_Name">Nome breve</msg>
<msg key="Site-Wide_Admin">Gestione sito</msg>
<msg key="Service_administration">Amministrazione servizi</msg>
<msg key="Service_parameters">Parametri servizi</msg>
<msg key="Short_Name">Nome Breve</msg>
<msg key="Site-Wide_Admin">Amministrazione a Livello di Sito</msg>
<msg key="Snapshot">Istantanea</msg>
<msg key="Start_time">Ora d&#39;avvio</msg>
<msg key="Start_time">Ora inizio</msg>
<msg key="Success">Successo</msg>
<msg key="Tcl_Callbacks">Callback TCL</msg>
<msg key="Tcl_Proc">Proc TCL</msg>
<msg key="Tcl_Callbacks">Callback Tcl</msg>
<msg key="Tcl_Proc">Proc Tcl</msg>
<msg key="Timestamp">Timestamp</msg>
<msg key="Type">Tipo</msg>
<msg key="User_Info">Info utente</msg>
<msg key="User_Info_help_text">L&#39;implementazione per recuperare le informazioni dell&#39;utente dall&#39;autorit in tempo reale</msg>
<msg key="Username">Nome utente</msg>
<msg key="View_log_entry">Visualizza elemento log</msg>
<msg key="Visit_service_pages">Visita pagine di servizio</msg>
<msg key="Yes">S</msg>
<msg key="You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name">Si stanno cambiando tutte le registrazioni utente nell&#39;autorit %authorities.pretty_name%</msg>
<msg key="User_Info">Info Utente</msg>
<msg key="User_Info_help_text">Implementazione per ottenere le informazioni utente dall&#39;authority in tempo reale.</msg>
<msg key="Username">Nome Utente</msg>
<msg key="View_log_entry">Visualizza log</msg>
<msg key="Visit_service_pages">Visita le pagine del servizio</msg>
<msg key="Yes">Si</msg>
<msg key="You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name">Stai modificando tutte le utenze perch ricadano sotto l&#39;autorit %authorities.pretty_name%</msg>
</message_catalog>
......@@ -14,7 +14,7 @@ set return_url [ad_pvt_home]
# Get the password and user ID
if {![db_0or1row password "select password from users where user_id=$user_id"]} {
if {![db_0or1row password {select password from users where user_id = :user_id}]} {
ad_return_error "Couldn't find user $user_id" "Couldn't find user $user_id."
return
}
......
......@@ -11,17 +11,22 @@ if { ![acs_user::site_wide_admin_p] } {
set user_id [ad_conn user_id]
set swadmin_p 0
db_multirow -extend { url admin_url param_url } packages services_select {} {
if { [file exists "[acs_package_root_dir $package_key]/www/"] } {
catch {
set url [apm_package_url_from_key $package_key]
if { $url ne "" && [file exists "[acs_package_root_dir $package_key]/www/admin/"] } {
set admin_url "${url}admin/"
}
if { [file exists "[acs_package_root_dir $package_key]/www/sitewide-admin/"] } {
set sitewide_admin_url "/acs-admin/package/$package_key/"
set swadmin_p 1
}
db_multirow -extend { url admin_url param_url sitewide_admin_url} packages services_select {} {
set root_dir [acs_package_root_dir $package_key]
set sitewide_admin_url ""
if { [file exists $root_dir/www/] } {
set url [apm_package_url_from_key $package_key]
if { $url ne "" && [file exists $root_dir/www/admin/] } {
set admin_url "${url}admin/"
}
if { [file exists $root_dir/www/sitewide-admin/]
&& [glob -nocomplain $root_dir/www/sitewide-admin/index.*] ne ""
} {
set sitewide_admin_url "/acs-admin/package/$package_key/"
set swadmin_p 1
}
if {[glob -nocomplain $root_dir/www/index.*] eq ""} {
set url ""
}
}
if { $parameter_count > 0 } {
......@@ -29,7 +34,7 @@ db_multirow -extend { url admin_url param_url } packages services_select {} {
}
set instance_name [lang::util::localize $instance_name]
if { $url eq "" && $admin_url eq "" && $param_url eq "" } {
if { $url eq "" && $admin_url eq "" && $param_url eq "" && $sitewide_admin_url eq ""} {
continue
}
}
......
......@@ -4,7 +4,7 @@
<li>OpenACS Packages
<ul>
<li><a href="@acs_admin_url@apm">Package Manager</a>
<li><a href="@acs_admin_url@install">Install Packages</a>
<li><a href="@acs_admin_url@install/">Install or Upgrade Packages</a>
<li><a href="@acs_lang_admin_url@">Internationalization/Localization</a>
</ul>
<li><a href="developer">Developer Tools</a>
......
......@@ -7,53 +7,56 @@ ad_library {
}
# Only run this if this is openacs.org
#ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 0 0] apm_build_repository
# we register the following filters only during startup, since
# existing connection threads are not aware of the throttle object.
if {[ns_server connections] == 0} {
#
# Register the filter progs for url statistics.
# The methods to be called have the name of the filter type.
#
ns_register_filter trace GET /repository/* repository-download
if {[info commands ::xo::db::require] ne ""} {
::xo::db::require table apm_package_downloads {
time timestamp
ip text
user_id integer
channel text
package text
version text
url text
}
ad_proc ::repository_log_to_db {} {
set ip [ns_conn peeraddr]
set user_id [ad_conn user_id]
set url [ns_conn url]
if {[regexp {^/repository/([^/]+)/(.*)-([^-]+).apm$} [ns_conn url] _ channel package version]} {
::xo::dc dml record_package_download \
"insert into apm_package_downloads(time, ip, user_id, channel, package, version, url) \
if {0} {
ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 0 0] apm_build_repository
# we register the following filters only during startup, since
# existing connection threads are not aware of the throttle object.
if {[ns_server connections] == 0} {
#
# Register the filter progs for url statistics.
# The methods to be called have the name of the filter type.
#
ns_register_filter trace GET /repository/* repository-download
if {[info commands ::xo::db::require] ne ""} {
::xo::db::require table apm_package_downloads {
time timestamp
ip text
user_id integer
channel text
package text
version text
url text
}
ad_proc ::repository_log_to_db {} {
set ip [ns_conn peeraddr]
set user_id [ad_conn user_id]
set url [ns_conn url]
if {[regexp {^/repository/([^/]+)/(.*)-([^-]+).apm$} [ns_conn url] _ channel package version]} {
::xo::dc dml record_package_download \
"insert into apm_package_downloads(time, ip, user_id, channel, package, version, url) \
values (now(), :ip, :user_id, :channel, :package, :version, :url)"
}
}
}
ad_proc ::repository-download {args} {
} {
ns_log notice "::repository-download called with <$args> [ad_conn user_id] <[ns_conn url]> [ns_conn peeraddr]"
set f [open $::acs::rootdir/log/apm.log a]
puts $f "[clock format [clock seconds]]\t[ns_conn peeraddr]\t[ad_conn user_id]\t[ns_conn url]"
close $f
if {[catch {::repository_log_to_db} errorMsg]} {
ns_log error "repository-download: $errorMsg"
}
return filter_ok
}
}
}
}
ad_proc ::repository-download {args} {
} {
ns_log notice "::repository-download called with <$args> [ad_conn user_id] <[ns_conn url]> [ns_conn peeraddr]"
set f [open $::acs::rootdir/log/apm.log a]
puts $f "[clock format [clock seconds]]\t[ns_conn peeraddr]\t[ad_conn user_id]\t[ns_conn url]"
close $f
if {[catch {::repository_log_to_db} errorMsg]} {
ns_log error "repository-download: $errorMsg"
}
return filter_ok
}
}
}
......
......@@ -109,9 +109,10 @@ ad_proc -private apm_package_selection_widget {
return ""
}
set label [dict get {install Install upgrade Upgrade all Install/Update} $operation]
set counter 0
set widget "<blockquote><table class='list-table' cellpadding='3' cellspacing='5' summary='Available Packages'>
<tr class='list-header'><th>Install</th><th>Package</th><th>Package Key</th><th>Comment</th></tr>"
set widget [subst {<blockquote><table class='list-table' cellpadding='3' cellspacing='5' summary='Available Packages'>
<tr class='list-header'><th>$label</th><th>Package</th><th>Package Key</th><th>Comment</th></tr>}]
foreach pkg_info $pkg_info_list {
......@@ -299,6 +300,14 @@ ad_proc -private apm_build_repository {
ns_log Notice "Repository: Found channel $channel using tag $tag_name"
set channel_tag($channel) $tag_name
}
} elseif { [regexp {^openacs-([1-9][0-9]*-[0-9]+-[0-9]+)-final$} $tag_name match oacs_version] } {
lassign [split $oacs_version "-"] major_version minor_version patch_version
#ns_log Notice "Repository: tag <$tag_name> oacs version <$oacs_version> split into /$major_version/$minor_version/$patch_version/"
if { $major_version >= 5 && $minor_version >= 8} {
set channel "${major_version}-${minor_version}-$patch_version"
ns_log Notice "Repository: Found channel $channel using tag $tag_name"
set channel_tag($channel) $tag_name
}
}
}
......@@ -311,7 +320,7 @@ ad_proc -private apm_build_repository {
#----------------------------------------------------------------------
# Wipe and re-create the working directory
file delete -force $work_dir
file delete -force -- $work_dir
file mkdir ${work_dir}
set update_pretty_date [lc_time_fmt [clock format [clock seconds] -format "%Y-%m-%d %T"] %c]
......@@ -323,8 +332,8 @@ ad_proc -private apm_build_repository {
ns_log Notice "Repository: Channel $channel using tag $channel_tag($channel)"
# Wipe and re-create the checkout directory
file delete -force "${work_dir}openacs-4"
file delete -force "${work_dir}dotlrn"
file delete -force -- "${work_dir}openacs-4"
file delete -force -- "${work_dir}dotlrn"
file mkdir "${work_dir}dotlrn/packages"
# Prepare channel directory
......@@ -456,7 +465,7 @@ ad_proc -private apm_build_repository {
file ${channel_dir}$pkg_info(package.key)-$pkg_info(name).apm:\
\n$errmsg\n$::errorCode,$::errorInfo"
}
file delete $tmp_filename
file delete -- $tmp_filename
}
set apm_url "${repository_url}$channel/$pkg_info(package.key)-$pkg_info(name).apm"
......@@ -491,7 +500,7 @@ ad_proc -private apm_build_repository {
set fw [open "${channel_dir}index.adp" w]
set packages [lsort $packages]
puts $fw "<master>\n<property name=\"doc(title)\">OpenACS $channel Compatible Packages</property>\n\n"
puts $fw "<h1>OpenACS $channel Core and compatibile packages</h1>
puts $fw "<h1>OpenACS $channel Core and compatible packages</h1>
<p>Packages can be installed with the OpenACS Automated Installer on
your OpenACS site at <code>/acs-admin/install</code>. Only packages
designated compatible with your OpenACS kernel will be shown.</p>
......@@ -576,9 +585,21 @@ ad_proc -private apm_build_repository {
ns_log Notice "Repository: Finishing Repository"
foreach channel [array names channel_tag] {
regexp {^([1-9][0-9]*)-([0-9]+)$} $channel . major minor
set tag_order([format %.3d $major]-[format %.3d $minor]) $channel
set tag_label($channel) "OpenACS $major.$minor"
if {[regexp {^([1-9][0-9]*)-([0-9]+)$} $channel . major minor]} {
#
# *-compat channels: The "patchlevel" of these channels is
# the highest possible value, higher than the released
# -final channels.
#
set tag_order([format %.3d $major]-[format %.3d $minor]-999) $channel
set tag_label($channel) "OpenACS $major.$minor"
} elseif {[regexp {^([1-9][0-9]*)-([0-9]+)-([0-9]+)$} $channel . major minor patch]} {
#
# *-final channels: a concrete patchlevel is provided.
#
set tag_order([format %.3d $major]-[format %.3d $minor]-[format %.3d $patch]) $channel
set tag_label($channel) "OpenACS $major.$minor.$patch"
}
}
......@@ -595,6 +616,10 @@ ad_proc -private apm_build_repository {
[list &channels channels update_pretty_date $update_pretty_date]]
close $fw
# Add a redirector for outdated releases
set fw [open "${work_dir}repository/index.vuh" w]
puts $fw "ns_returnredirect /repository/"
close $fw
# Without the trailing slash
set work_repository_dirname "${work_dir}repository"
......@@ -604,12 +629,12 @@ ad_proc -private apm_build_repository {
ns_log Notice "Repository: Moving work repository $work_repository_dirname to live repository dir at <a href=\"/repository\/>$repository_dir</a>\n"
if { [file exists $repository_bak] } {
file delete -force $repository_bak
file delete -force -- $repository_bak
}
if { [file exists $repository_dirname] } {
file rename $repository_dirname $repository_bak
file rename -- $repository_dirname $repository_bak
}
file rename $work_repository_dirname $repository_dirname
file rename -- $work_repository_dirname $repository_dirname
ns_log Debug "Repository: DONE"
......
......@@ -22,16 +22,16 @@ ad_proc -public merge::MergeUserInfo {
} {
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*}
if { ![db_0or1row to_user_portrait {}] && [db_0or1row from_user_portrait {}] } {
db_dml upd_portrait {}
}
# get the permissions of the from_user_id
# and grant them to the to_user_id
db_foreach getfromobjs {*SQL*} {
db_foreach getfromobjs {} {
# 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*} ] } {
if { ![db_string touserhas {} ] } {
# grant the permissions to to_user_id
permission::grant -object_id $from_oid -party_id $to_user_id -privilege $from_priv
}
......@@ -39,7 +39,7 @@ ad_proc -public merge::MergeUserInfo {
ns_log notice " Merging acs_objects"
db_dml acs_objs_upd {*SQL*}
db_dml acs_objs_upd {}
}
ns_log Notice "Finishing merge::MergeUserInfo"
}
......
......@@ -98,7 +98,7 @@ ns_write "<li>Channels are: [array get channel_tag]</ul>\n"
#----------------------------------------------------------------------
# Wipe and re-create the working directory
file delete -force $work_dir
file delete -force -- $work_dir
file mkdir ${work_dir}
cd $work_dir
......@@ -106,7 +106,7 @@ foreach channel [lsort -decreasing [array names channel_tag]] {
ns_write "<h2>Channel $channel using tag $channel_tag($channel)</h2><ul>"
# Wipe and re-create the checkout directory
file delete -force "${work_dir}openacs-4"
file delete -force -- "${work_dir}openacs-4"
# Prepare channel directory
set channel_dir "${work_dir}repository/${channel}/"
......@@ -297,12 +297,12 @@ set repository_bak "[string range $repository_dir 0 end-1].bak"
ns_write "<li>Moving work repository $work_repository_dirname to live repository dir at <a href=\"/repository\/>$repository_dir</a>\n"
if { [file exists $repository_bak] } {
file delete -force $repository_bak
file delete -force -- $repository_bak
}
if { [file exists $repository_dirname] } {
file rename $repository_dirname $repository_bak
file rename -- $repository_dirname $repository_bak
}
file rename $work_repository_dirname $repository_dirname
file rename -- $work_repository_dirname $repository_dirname
ns_write "</ul> <h2>DONE</h2>\n"
......
......@@ -3,7 +3,7 @@
<fullquery name="email_by_user_id">
<querytext>
select email from parties where party_id = [auth::require_login]
select email from parties where party_id = [ad_get_user_id]
</querytext>
</fullquery>
......
......@@ -8,7 +8,7 @@ ad_page_contract {
@cvs-id $Id$
} {
{watch_file ""}
{return_url ""}
{return_url:localurl ""}
}
apm_file_watch_cancel $watch_file
......
......@@ -9,7 +9,7 @@ ad_page_contract {
} {
version_id:naturalnum,notnull
paths:multiple
{return_url ""}
{return_url:localurl ""}
}
set package_key [apm_package_key_from_version_id $version_id]
......
......@@ -14,7 +14,7 @@
<querytext>
select v.version_id, v.package_key, t.pretty_name, v.version_name,
to_char(v.release_date, 'YYYY-MM-DD') as release_date
to_char(v.release_date, 'YYYY-MM-DD') as release_date,
v.enabled_p, v.installed_p, v.distribution_uri,
(select count(*) from apm_package_versions v2
where v2.package_key = v.package_key
......
......@@ -16,7 +16,7 @@
<ul>
<li><a href="package-add">Create a new package.</a>
<li><a href="write-all-specs">Write new specification files for all installed, locally generated packages.</a>
<li><a href="/acs-admin/install">Install packages.</a>
<li><a href="/acs-admin/install/">Install or Upgrade packages.</a>
</ul>
@watches_html;noquote@
......@@ -24,14 +24,14 @@
<h3>Help</h3>
<blockquote>
<p>A package is <b>enabled</b> if it is scheduled to run at server startup
<p>A package is <strong>enabled</strong> if it is scheduled to run at server startup
and is deliverable by the request processor.
</p>
<p>If a Tcl library file (<tt>*-procs.tcl</tt>) or query file (<tt>*.xql</tt>) is being
<b>watched</b>, the request processor monitors it, reloading it into running interpreters
<p>If a Tcl library file (<kbd>*-procs.tcl</kbd>) or query file (<kbd>*.xql</kbd>) is being
<strong>watched</strong>, the request processor monitors it, reloading it into running interpreters
whenever it is changed. This is useful during development
(so you don't have to restart the server for your changes to take
effect). To watch a file, click its package key above, click <i>Manage file
information</i> on the next screen, and click <i>watch</i> next to
effect). To watch a file, click its package key above, click <em>Manage file
information</em> on the next screen, and click <em>watch</em> next to
the file's name on the following screen.
</blockquote>
......@@ -21,10 +21,10 @@ set context [list \
$title]
set form_name "packageAdd"
set body "<form name='$form_name' action='package-add-2' method='post'>\n"
append body [subst {
set body [subst {
<form name='$form_name' action='package-add-2' method='post'>
[export_vars -form {package_id version_id}]
<script type="text/javascript">
<script type="text/javascript" nonce='$::__csp_nonce'>
function updateURLs() {
// Update the package and version URL, if the package key and/or version name change.
var form = document.getElementsByName('$form_name')\[0\];
......@@ -33,16 +33,14 @@ function updateURLs() {
if ((form.version_name.value != '') && (form.version_uri.value == ''))
form.version_uri.value = 'http://openacs.org/repository/download/apm/' + form.package_key.value + '-' + form.version_name.value + '.apm';
}
</script>
<script type="text/javascript">
function checkMailto(element) {
// If it looks like an email address without a mailto: (contains an @ but
// no colon) then prepend 'mailto:'.
if (element.value.indexOf('@') >= 0 && element.value.indexOf(':') < 0)
element.value = 'mailto:' + element.value;
}
</script>
</script>
<table>
......@@ -56,7 +54,7 @@ Files for your package will be placed in a directory with this name.</td>
<tr>
<th align="right" nowrap>Package Key:</th>
<td><input name="package_key" size="30" onChange="updateURLs()"></td>
<td><input name="package_key" size="30" class="update-url"></td>
</tr>
<tr>
......@@ -151,7 +149,7 @@ an optional suffix of <strong>d</strong> for development, <strong>a</strong> for
<tr>
<th align="right" nowrap>Initial Version:</th>
<td><input name="version_name" size="10" onChange="updateURLs()"></td>
<td><input class="update-url" name="version_name" size="10"></td>
</tr>
<tr>
......@@ -210,7 +208,7 @@ for URLs, in which case you should precede them with <tt>mailto:</tt> (e.g.,
</tr>
<tr>
<th align="right" nowrap>Primary Owner URL:</th>
<td><input name="owner_uri" size="30" value="mailto:$email" onChange="checkMailto(this)"></td>
<td><input name="owner_uri" size="30" value="mailto:$email" class="check-mailto"></td>
</tr>
<tr>
<th align="right" nowrap>Secondary Owner:</th>
......@@ -218,7 +216,7 @@ for URLs, in which case you should precede them with <tt>mailto:</tt> (e.g.,
</tr>
<tr>
<th align="right" nowrap>Secondary Owner URL:</th>
<td><input name="owner_uri" size="30" onChange="checkMailto(this)"></td>
<td><input name="owner_uri" size="30" class="check-mailto"></td>
</tr>
<tr>
......@@ -257,10 +255,13 @@ this package, please load them manually into your database.
</table>
}]
ad_return_template apm
# Add event listener for updating urls and checking mailto urls
template::add_event_listener -CSSclass "update-url" -event change -script {updateURLs();}
template::add_event_listener -CSSclass "check-mailto" -event change -script {checkMailto(this);}
ad_return_template apm
# Local variables:
# mode: tcl
......
......@@ -5,7 +5,7 @@ ad_page_contract {
@cvs-id $Id$
} {
{package_key:notnull}
{return_url /acs/admin/apm}
{return_url:localurl /acs/admin/apm}
}
apm_package_instance_new -package_key $package_key
ad_returnredirect $return_url
......
......@@ -9,7 +9,7 @@ ad_page_contract {
} {
{url ""}
{file_path ""}
{delete 0}
{delete:boolean 0}
} -validate {
url_xor_file_path {
......@@ -24,7 +24,7 @@ ad_page_contract {
}
if {$delete} {
file delete -force [apm_workspace_install_dir]
file delete -force -- [apm_workspace_install_dir]
}
set title "Contents of Loaded Package"
......@@ -55,7 +55,7 @@ if {$file_path eq ""} {
ns_log Debug "APM: Loading $file_path"
# If file_path ends in .apm, then load the single package.
if { [file extension $file_path] eq "apm" || $url_param ne ""} {
if { [file extension $file_path] eq ".apm" || $url_param ne ""} {
apm_load_apm_file {*}$url_param -callback apm_ns_write_callback $file_path
} else {
# See if this is a directory.
......
......@@ -11,7 +11,7 @@ Otherwise, please specify a filesystem location for the packages you want to ins
You can also copy the extracted package files directly into the <code>@acs::rootdir@/packages/</code> directory if you prefer.
<p>
Load a package from the <tt>.apm</tt> file at this URL:
Load a package from the <kbd>.apm</kbd> file at this URL:
<blockquote>http:// <input name="url" size="50"></blockquote>
<p>
Specify a local path including a filename for the APM file or a directory containing several APM files.<p>
......
......@@ -5,7 +5,7 @@ ad_page_contract {
@cvs-id $Id$
} {
package_key
{return_url "index"}
{return_url:localurl "index"}
}
apm_cancel_all_watches $package_key
......
......@@ -6,7 +6,7 @@ ad_page_contract {
@cvs-id $Id$
} {
package_key
{return_url "index"}
{return_url:localurl "index"}
}
apm_watch_all_files $package_key
......
......@@ -29,6 +29,7 @@ if {$package_key eq ""} {
#
#####
apm_get_package_repository -array repository
apm_get_installed_versions -array installed
set install_pkgs $package_key
while 1 {
......@@ -63,15 +64,24 @@ if {$package_key eq ""} {
#
# Load package info from spec file.
#
unset -nocomplain spec_file
if {[catch {set spec_file [apm_package_info_file_path $pkg]}]} {
#
# In case the spec file is not found (unknown package)
# produce an empty entry.
#
array set package [list package.key $pkg embeds "" extends "" \
provides "" requires "" properties {install ""}]
} else {
set workspace_dir [apm_workspace_install_dir]
if {[catch {set spec_file [apm_package_info_file_path -path $workspace_dir $pkg]}]} {
#
# In case the spec file is not found (unknown package)
# produce an empty entry.
#
array set package [list package.key $pkg embeds "" extends "" \
provides "" requires "" properties {install ""}]
}
}
if {[info exists spec_file]} {
array set package [apm_read_package_info_file $spec_file]
} else {
ad_return_complaint 1 "Could not find .info file of dependency: $pkg."
ad_script_abort
}
if {[info exists failed($pkg)]} {
......@@ -86,13 +96,14 @@ if {$package_key eq ""} {
set must_add {}
foreach p $properties(install) {
if {$p ni $install_pkgs} {
if {$p ni $install_pkgs && ![info exists installed($p)]} {
#ns_log notice "+++ install_pkgs <$p> ni <$install_pkgs> and not already installed"
lappend must_add $p
}
}
if {[llength $must_add] > 0} {
lappend install_pkgs {*}$must_add
ns_log notice "+++ install_pkgs <$install_pkgs> after must_add <$must_add>"
lappend install_pkgs {*}$must_add
set fixpoint_p 0
break
}
......
......@@ -31,11 +31,7 @@ foreach pkg_info [ad_get_client_property apm pkg_install_list] {
if { [apm_package_upgrade_p $package_key $final_version_name] == 1} {
ns_log Debug "Upgrading package [string totitle $version(package-name)] to $final_version_name."
set upgrade_p 1
set initial_version_name [db_string apm_package_upgrade_from {
select version_name from apm_package_versions
where package_key = :package_key
and version_id = apm_package.highest_version(:package_key)
} -default ""]
set initial_version_name [db_string apm_package_upgrade_from {} -default ""]
} else {
set upgrade_p 0
set initial_version_name ""
......
......@@ -22,13 +22,13 @@ ad_return_top_of_page [ad_parse_template \
-params [list context title] \
[template::streaming_template]]
ns_write {
ns_write [subst {
<h2>Installing packages...</h2>
<script>var myInterval = setInterval(function(){window.scrollTo(0,document.body.scrollHeight)}, 300);
<script nonce='$::__csp_nonce'>var myInterval = setInterval(function(){window.scrollTo(0,document.body.scrollHeight)}, 300);
</script>
<p>
<ul>
}
}]
# We have a set of SQL files that need to be sourced at the appropriate time.
......@@ -51,13 +51,14 @@ foreach pkg_info $pkg_install_list {
continue
}
if {[apm_package_version_installed_p $version(package.key) $version(name)] } {
#ns_log notice "===== ALREADY-installed $version(package.key)"
set package_key $version(package.key)
if {[apm_package_version_installed_p $package_key $version(name)] } {
#ns_log notice "===== ALREADY installed $package_key"
# Already installed.
continue
}
set package_key $version(package.key)
set version_files $version(files)
set data_model_files [list]
......@@ -86,7 +87,7 @@ foreach pkg_info $pkg_install_list {
set enable_p 1
if {[catch {
ns_log notice "===== INSTALL $version(package.key)"
ns_log notice "===== INSTALL $package_key"
set version_id [apm_package_install \
-enable=$enable_p \
-package_path $package_path \
......@@ -95,7 +96,7 @@ foreach pkg_info $pkg_install_list {
-data_model_files $data_model_files \
-mount_path $selected_mount_path \
$spec_file]
ns_log notice "===== INSTALL $version(package.key) DONE"
ns_log notice "===== INSTALL $package_key DONE"
} errorMsg]} {
ns_write "Error: $errorMsg\n"
......@@ -107,10 +108,11 @@ foreach pkg_info $pkg_install_list {
# Installation of the package failed and we shouldn't continue with installation
# as there might be packages depending on the failed package. Ideally we should
# probably check for such dependencies and continue if there are none.
ns_write {
ns_write [subst {
</ul>
<script>window.scrollTo(0,document.body.scrollHeight);clearInterval(myInterval);</script>
}
<script nonce='$::__csp_nonce'>window.scrollTo(0,document.body.scrollHeight);clearInterval(myInterval);
</script>
}]
ad_script_abort
}
......@@ -126,13 +128,13 @@ if {$installed_count < 1} {
} else {
ns_write {</ul><p>
Done installing packages.
<p>You should restart the server now to make installed and upgraded packages available.
<a href="../server-restart">Click here</a> to restart the server now.</p>
<p>You should restart the server now to make installed and upgraded packages available.</p>
<p><a href="../server-restart" class="button">Click here</a> to restart the server now.</p>
}
}
ns_write {
<script>window.scrollTo(0,document.body.scrollHeight);clearInterval(myInterval);</script>
}
ns_write [subst {
<script nonce='$::__csp_nonce'>window.scrollTo(0,document.body.scrollHeight);clearInterval(myInterval);</script>
}]
# Local variables:
# mode: tcl
......
......@@ -103,26 +103,29 @@ if { $spec_files eq "" } {
}]
set formName "pkgsForm"
append body [subst {
<script type="text/javascript">
function uncheckAll() {
template::add_event_listener \
-id check_all \
-script [subst {
var install_form = document.getElementsByName('$formName')\[0\];
for (var i = 0; i < install_form.length; ++i) {
install_form.elements\[i\].checked = false;
install_form.elements\[i\].checked = true;
//install_form.elements\[i\].href = '';
}
}
function checkAll() {
}]
template::add_event_listener \
-id uncheck_all \
-script [subst {
var install_form = document.getElementsByName('$formName')\[0\];
for (var i = 0; i < install_form.length; ++i) {
install_form.elements\[i\].checked = true;
//install_form.elements\[i\].href = '';
install_form.elements\[i\].checked = false;
}
}
</script>
<a href="#" onclick="javascript:uncheckAll();return false;"><b>uncheck all boxes</b></a> |
<a href="#" onclick="javascript:checkAll();return false;"><b>check all boxes</b></a>
}]
}]
append body {
<a href="#" id="uncheck_all"><b>uncheck all boxes</b></a> |
<a href="#" id="check_all"><b>check all boxes</b></a>
}
#packages-install?checked_by_default_p=1
append body "<form name='$formName' action='packages-install-2' method='post'>\n"
......
......@@ -34,3 +34,9 @@ if { [db_string apm_archive_exist_p {
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -11,7 +11,7 @@
<a href="/xowiki/@pkgs.package_key@">@pkgs.package_key@</a>
</td>
<td style="border-color:gray;">
<b>@pkgs.pretty_name@:</b><br><em>@pkgs.summary@</em>
<strong>@pkgs.pretty_name@:</strong><br><em>@pkgs.summary@</em>
<p>@pkgs.description;noquote@
<p><small>@pkgs.package_key@ @pkgs.version@ released @pkgs.release_date@
<if @pkgs.license@ not nil>
......
......@@ -10,7 +10,11 @@ ad_page_contract {
{type ""}
}
db_1row package_version_info "select pretty_name, version_name from apm_package_version_info where version_id = :version_id"
db_1row package_version_info {
select pretty_name, version_name
from apm_package_version_info
where version_id = :version_id
}
set return_url [export_vars -base version-callbacks { version_id }]
......
......@@ -13,5 +13,5 @@
</else>
<p>
<b>&raquo;</b> <a href="@return_url@">Go back</a>
<strong>&raquo;</strong> <a href="@return_url@">Go back</a>
</p>
......@@ -9,7 +9,11 @@ ad_page_contract {
type:notnull
}
db_1row package_version_info "select pretty_name, version_name from apm_package_version_info where version_id = :version_id"
db_1row package_version_info {
select pretty_name, version_name
from apm_package_version_info
where version_id = :version_id
}
set return_url [export_vars -base version-callbacks { version_id }]
......
......@@ -7,10 +7,16 @@ ad_page_contract {
version_id:naturalnum,notnull
}
db_1row package_version_info "select pretty_name, version_name from apm_package_version_info where version_id = :version_id"
db_1row package_version_info {
select pretty_name, version_name
from apm_package_version_info
where version_id = :version_id
}
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 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]
......
......@@ -38,20 +38,17 @@ if { $version_name_index >= 0 } {
set version_uri_suffix [string range $version_uri $version_name_index+[string length $version_name] end]
append body [subst {
<script type="text/javascript">
<script type="text/javascript" nonce='$::__csp_nonce'>
function updateVersionURL() {
var form = document.forms\[0\];
form.version_uri.value = "$version_uri_prefix" + form.version_name.value + "$version_uri_suffix";
}
</script>
}]
set version_name_on_change "onChange=\"updateVersionURL()\""
} else {
set version_name_on_change ""
</script>}]
template::add_event_listener -CSSclass "update-version-url" -event change -script {updateVersionURL();}
}
append body [subst {
<script type="text/javascript">
<script type="text/javascript" nonce='$::__csp_nonce'>
function checkMailto(element) {
// If it looks like an email address without a mailto: (contains an @ but
// no colon) then prepend 'mailto:'.
......@@ -112,7 +109,7 @@ edit the information regarding existing version of the package.</td>
<tr>
<th style="text-align:right; white-space: nowrap">Version:</th>
<td><input name="version_name" size="10" value="$version_name" $version_name_on_change>
<td><input name="version_name" size="10" value="$version_name" class="update-version-url">
</td>
</tr>
......@@ -194,7 +191,7 @@ foreach owner_info $owners {
</tr>
<tr>
<th style="text-align:right; white-space: nowrap">$prompt URL:</th>
<td><input name="owner_uri" size="30" value="$owner_uri" onChange="checkMailto(this)"></td>
<td><input name="owner_uri" size="30" value="$owner_uri" class="check-mailto"></td>
</tr>
}]
}
......@@ -233,6 +230,8 @@ append body [subst {
</form>
}]
template::add_event_listener -CSSclass "check-mailto" -event change -script {checkMailto(this);}
ad_return_template apm
# Local variables:
......
......@@ -39,7 +39,10 @@ foreach file [apm_get_package_files -package_key $package_key] {
continue
}
set cmd [list exec /usr/bin/diff]
if {[set diff [util::which diff]] eq ""} {
error "'diff' command not found on the system"
}
set cmd [list exec $diff]
if { $context_p } {
lappend cmd "-c"
}
......
......@@ -7,9 +7,9 @@
</p>
<p>
Catalog files are stored in the directory <b>@catalog_dir@</b>.
Catalog files are stored in the directory <strong>@catalog_dir@</strong>.
</p>
<p>
<b>&raquo;</b> <a href="@return_url@">Return</a>
<strong>&raquo;</strong> <a href="@return_url@">Return</a>
</p>
......@@ -6,7 +6,7 @@ ad_page_contract {
@cvs-id $Id$
} {
version_id:naturalnum,notnull
{return_url {[export_vars -base "version-i18n-index" { version_id }]}}
{return_url:localurl {[export_vars -base "version-i18n-index" { version_id }]}}
}
db_1row package_version_info {
......
......@@ -7,9 +7,9 @@
</p>
<p>
Catalog files have been loaded from the directory <b>@catalog_dir@</b>.
Catalog files have been loaded from the directory <strong>@catalog_dir@</strong>.
</p>
<p>
<b>&raquo;</b> <a href="@return_url@">Return</a>
<strong>&raquo;</strong> <a href="@return_url@">Return</a>
</p>
......@@ -6,7 +6,7 @@ ad_page_contract {
@cvs-id $Id$
} {
version_id:naturalnum,notnull
{return_url {[export_vars -base "version-i18n-index" { version_id }]}}
{return_url:localurl {[export_vars -base "version-i18n-index" { version_id }]}}
}
db_1row package_version_info {
......
......@@ -5,13 +5,13 @@
<h3>Import/Export Messages</h3>
<p>
<b>&raquo;</b> <a href="@export_url@"><b>Export</b>
<strong>&raquo;</strong> <a href="@export_url@"><strong>Export</strong>
messages from the database to catalog files</a>
</p>
<p>
<b>&raquo;</b> <a
href="@import_url@"><b>Import</b>
<strong>&raquo;</strong> <a
href="@import_url@"><strong>Import</strong>
messages from catalog files to the database</a>
</p>
......@@ -19,14 +19,14 @@
<h3>Localize Package</h3>
<p>
<b>&raquo;</b> <a href="@localize_url@">Localize messages in this package</a>
<strong>&raquo;</strong> <a href="@localize_url@">Localize messages in this package</a>
</p>
<h3>Internationalize Package</h3>
<p>
<b>&raquo;</b>
<a href="version-i18n?version_id=@version_id@"><b>Convert</b> ADP,
<strong>&raquo;</strong>
<a href="version-i18n?version_id=@version_id@"><strong>Convert</strong> ADP,
Tcl, and SQL files to using the message catalog</a>.
</p>
......@@ -34,9 +34,9 @@
<h3>Convert Message Catalog to New Format</h3>
<p>
<b>&raquo;</b>
<strong>&raquo;</strong>
<a
href="version-i18n-import?version_id=@version_id@&format=tcl"><b>Import</b>
href="version-i18n-import?version_id=@version_id@&format=tcl"><strong>Import</strong>
old Tcl-based catalog files (.cat files) into the
database</a>. This will allow you to export them back out in the
new format. (NB! Overwrites texts in the database)
......
......@@ -5,5 +5,5 @@
@processing_html_result;noquote@
<p>
<b>=&gt;</b> <a href="@proceed_url@">@proceed_label;noquote@</a>
<strong>=&gt;</strong> <a href="@proceed_url@">@proceed_label;noquote@</a>
</p>
ad_page_contract {
Internationalize a certain adp or tcl file.
Internationalize a certain adp or Tcl file.
@author Peter Marklund (peter@collaboraid.biz)
@creation-date 8 October 2002
......
......@@ -3,7 +3,7 @@
<property name="context_bar">@context_bar;literal@</property>
<p>
<b>Current File:</b> @file@
<strong>Current File:</strong> @file@
</p>
<blockquote>
......
......@@ -11,7 +11,11 @@ ad_page_contract {
{file_action:multiple}
}
db_1row package_version_info "select pretty_name, version_name from apm_package_version_info where version_id = :version_id"
db_1row package_version_info {
select pretty_name, version_name
from apm_package_version_info
where version_id = :version_id
}
set page_title "Internationalization of $pretty_name $version_name"
set context_bar [ad_context_bar $page_title]
......
ad_page_contract {
A form to help semi-automate the conversion of tcl and adp files from using literal
A form to help semi-automate the conversion of Tcl and adp files from using literal
text strings to using the message catalog.
@author Peter Marklund (peter@collaboraid.biz)
......@@ -13,9 +13,13 @@ ad_page_contract {
{file_type adp}
}
db_1row package_version_info "select pretty_name, version_name from apm_package_version_info where version_id = :version_id"
db_1row package_version_info {
select pretty_name, version_name
from apm_package_version_info
where version_id = :version_id
}
set page_title "Message catalog lookups for adp and tcl files of $pretty_name $version_name"
set page_title "Message catalog lookups for adp and Tcl files of $pretty_name $version_name"
set context_bar [ad_context_bar $page_title]
set file_option_list [list]
......@@ -147,7 +151,7 @@ switch -- $file_type {
set href2 [export_vars -base version-i18n -override {{file_type sql}} {version_id pre_select_files_p show_status_p only_text_p}]
set file_type_filter [subst {
<b>Show adp files</b>: $text_only_filter |
<a href="[ns_quotehtml $href1]">Show tcl files</a> |
<a href="[ns_quotehtml $href1]">Show Tcl files</a> |
<a href="[ns_quotehtml $href2]">Show sql files</a>
}]
}
......@@ -156,7 +160,7 @@ switch -- $file_type {
set href2 [export_vars -base version-i18n -override {{file_type sql}} {version_id pre_select_files_p show_status_p only_text_p}]
set file_type_filter [subst {
<a href="[ns_quotehtml $href1]">Show adp files</a> |
<b>Show tcl files</b> |
<b>Show Tcl files</b> |
<a href="[ns_quotehtml $href2]">Show sql files</a>
}]
}
......@@ -166,7 +170,7 @@ switch -- $file_type {
set file_type_filter [subst {
<a href="[ns_quotehtml $href1]">Show adp files</a> |
<a href="[ns_quotehtml $href2]">Show tcl files</a> |
<a href="[ns_quotehtml $href2]">Show Tcl files</a> |
<b>Show sql files</b>
}]
}
......
......@@ -11,15 +11,3 @@
@body;noquote@
<!--
<script type="text/javascript">
<% template::head::add_javascript -src "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" %>
$('#files dd').click(function () {
$(this).slideToggle();
});
$('#files dt').click(function () {
$(this.nextElementSibling).slideToggle();
});
</script>
-->
......@@ -7,7 +7,7 @@ ad_page_contract {
@cvs-id $Id$
} {
{version_id:naturalnum,notnull}
{return_url "index"}
{return_url:localurl "index"}
}
apm_version_info $version_id
......
......@@ -40,26 +40,9 @@ set downloaded_p [ad_decode $version_uri "" 0 1]
# Obtain information about the enabled version of the package (if there is one).
# We use rownum = 1 in case someone mucks up the database and leaves two package versions
# installed and enabled.
db_0or1row apm_enabled_version_info {
select version_id as installed_version_id, version_name as installed_version_name,
enabled_p as installed_enabled_p,
apm_package_version.version_name_greater(version_name, :version_name) as version_name_greater
from apm_package_versions
where package_key = :package_key
and installed_p = 't'
and rownum = 1
}
db_0or1row apm_enabled_version_info {}
db_0or1row apm_data_model_install_version {
select data_model_installed_version from (
select version_name as data_model_installed_version
from apm_package_versions
where package_key = :package_key
and data_model_loaded_p = 't'
order by apm_package_version.sortable_version_name(version_name) desc
)
where rownum = 1
}
db_0or1row apm_data_model_install_version {}
if { $vendor eq "" } {
set vendor $vendor_uri
......
......@@ -18,7 +18,7 @@ if { [auth::can_admin_system_without_authority_p -authority_id $authority_id] }
ad_returnredirect "."
} else {
ad_return_error "Cannot delete authority" "Deleting this authority would mean that all site-wide administrator users are shut out from the system, meaning the system could no longer be adminstered."
ad_return_error "Cannot delete authority" "Deleting this authority would mean that all site-wide administrator users are shut out from the system, meaning the system could no longer be administered."
}
# Local variables:
......
......@@ -3,7 +3,7 @@
<property name="doc(title)">@page_title;literal@</property>
<property name="focus">parameters.@first_param_name;noquote@</property>
<if @has_parameters_p@>
<if @has_parameters_p;literal@ true>
<formtemplate id="parameters"></formtemplate>
</if>
<else>
......
......@@ -22,7 +22,7 @@ if { $allowed_p } {
ad_returnredirect .
ad_script_abort
} else {
ad_return_error "Cannot disable authority" "Disabling this authority would mean that all site-wide administrator users are shut out from the system, meaning the system could no longer be adminstered."
ad_return_error "Cannot disable authority" "Disabling this authority would mean that all site-wide administrator users are shut out from the system, meaning the system could no longer be administered."
}
# Local variables:
......
......@@ -5,7 +5,7 @@
<if @configure_url@ not nil>
<p>
<b>&raquo;</b> <a href="@configure_url@">Configure drivers for this authority</a>
<strong>&raquo;</strong> <a href="@configure_url@">Configure drivers for this authority</a>
</p>
</if>
......@@ -13,14 +13,15 @@
<if @configure_url@ not nil>
<p>
<b>&raquo;</b> <a href="@configure_url@">Configure drivers for this authority</a>
<strong>&raquo;</strong> <a href="@configure_url@">Configure drivers for this authority</a>
</p>
</if>
<p>
<b>&raquo;</b> <a href="@show_users_url@">Show users in this authority</a> (@num_users@ users)
<strong>&raquo;</strong> <a href="@show_users_url@">Show users in this authority</a> (@num_users@ users)
</p>
<if @import_users_url@ not nil>
<p>
<b>&raquo;</b> <a href="@import_users_url@">Batch-import users for this authority</a>
......@@ -34,12 +35,13 @@
</if>
<if @display_batch_history_p@ true>
<if @display_batch_history_p;literal@ true>
<h2>Batch Jobs</h2>
<if @batch_sync_run_url@ not nil>
<p>
<b>&raquo;</b> <a href="@batch_sync_run_url@" onclick="return confirm('Are you sure you want to run a batch job to sync the user database now?');">Run new batch job now</a>
<strong>&raquo;</strong> <a href="@batch_sync_run_url@" id="batch-sync-run" class="button">Run new batch job now</a>
</p>
</if>
......
......@@ -9,7 +9,7 @@ ad_page_contract {
}
set page_title ""
if { ([info exists authority_id] && $authority_id ne "") } {
if { [info exists authority_id] && $authority_id ne "" } {
# Initial request in display or edit mode or a submit of the form
set authority_exists_p [db_string authority_exists_p {
select count(*)
......@@ -273,7 +273,6 @@ if { $display_batch_history_p } {
set end_time_pretty [lc_time_fmt $end_time_ansi "%x %X"]
set interactive_pretty [ad_decode $interactive_p "t" "Yes" "No"]
set short_message [string_truncate -len 30 -- $message]
set actions_per_minute {}
......@@ -282,8 +281,12 @@ if { $display_batch_history_p } {
}
set run_time [util::interval_pretty -seconds $run_time_seconds]
}
if { ([info exists get_doc_impl_id] && $get_doc_impl_id ne "") && ([info exists process_doc_impl_id] && $process_doc_impl_id ne "") } {
if { ([info exists get_doc_impl_id] && $get_doc_impl_id ne "")
&& ([info exists process_doc_impl_id] && $process_doc_impl_id ne "") } {
set batch_sync_run_url [export_vars -base batch-job-run { authority_id }]
template::add_confirm_handler \
-id batch-sync-run \
-message "Are you sure you want to run a batch job to sync the user database now?"
} else {
# If there's neither a driver, nor any log history to display, hide any mention of batch jobs
if { ${batch_jobs:rowcount} == 0 } {
......@@ -294,14 +297,19 @@ if { $display_batch_history_p } {
set context [list [list "." "Authentication"] $page_title]
if { ([info exists authority_id] && $authority_id ne "") } {
set num_users [lc_numeric [db_string num_users_in_auhtority { select count(*) from users where authority_id = :authority_id }]]
if { [info exists authority_id] && $authority_id ne "" } {
set num_users [lc_numeric [db_string num_users_in_auhtority {
select count(*) from users where authority_id = :authority_id
}]]
} else {
set num_users 0
}
set show_users_url [export_vars -base ../users/complex-search { authority_id { target one } }]
set import_users_url [export_vars -base "/auth-ldap-adldapsearch/import-users"]
# This code should be executed for non-local authorities in the following types of requests:
# - initial request of the form (display mode)
# - The form is being submitted (display mode)
......@@ -322,12 +330,6 @@ if { ($initial_request_p || $submit_p) && !$local_authority_p } {
}
}
set import_users_url [export_vars -base "/auth-ldap-adldapsearch/import-users"]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
......
......@@ -5,5 +5,5 @@
<p> Batch sync completed. </p>
<p>
<b>&raquo;</b> <a href="@job_url@">View job results</a>
<strong>&raquo;</strong> <a href="@job_url@">View job results</a>
</p>
......@@ -64,7 +64,7 @@ list::create \
<case value="can_select">
<a href="@authorities.registration_url@"
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\#');">
id="@authorities.select_id;literal@">
<img src="/resources/acs-subsite/radio.gif" height="13" width="13" style="background-color: white; border: 0;" alt="unchecked">
</a>
</case>
......@@ -89,7 +89,7 @@ list::create \
<if @authorities.short_name@ ne local>
<a href="@authorities.delete_url@"
title="Delete this authority"
onclick="return confirm('\#acs-admin.Are_you_sure_you_want_to_delete_authority_authorities_pretty_name\#');">
id="@authorities.delete_id;literal@">
<img src="/shared/images/Delete16.gif" height="16" width="16" alt="\#acs-admin.Delete\#" style="border:0">
</a>
</if>
......@@ -98,6 +98,7 @@ list::create \
}
}
# The authority currently selected for registering users
set register_authority_id [auth::get_register_authority]
......@@ -108,6 +109,7 @@ db_multirow -extend {
delete_url
registration_url
registration_status
select_id delete_id
} authorities authorities_select {
select authority_id,
short_name,
......@@ -127,7 +129,8 @@ db_multirow -extend {
set delete_url [export_vars -base authority-delete { authority_id }]
set sort_order_url_up [export_vars -base authority-set-sort-order { authority_id {direction up} }]
set sort_order_url_down [export_vars -base authority-set-sort-order { authority_id {direction down} }]
set select_id select-authority-$authority_id
set delete_id delete-authority-$authority_id
if {$authority_id eq $register_authority_id} {
# The authority is selected as register authority
set registration_status "selected"
......@@ -135,15 +138,32 @@ db_multirow -extend {
# The authority can be selected as register authority
set registration_status "can_select"
set registration_url [export_vars -base authority-registration-select { authority_id }]
template::add_confirm_handler \
-id $select_id \
-message [_ acs-admin.You_are_changing_all_user_registrations_to_be_in_authority_authorities_pretty_name \
[list authorities.pretty_name $pretty_name]]
} else {
# This authority has no account creation driver
set registration_status "cannot_select"
}
}
if {$short_name ne "local"} {
template::add_confirm_handler \
-id $delete_id \
-message [_ acs-admin.Are_you_sure_you_want_to_delete_authority_authorities_pretty_name \
[list authorities.pretty_name $pretty_name]]
}
}
set auth_package_id [apm_package_id_from_key "acs-authentication"]
set parameter_url [export_vars -base /shared/parameters { { package_id $auth_package_id } { return_url [ad_return_url] } }]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
# ----------------------------------------------------------
# Left Navbar
# ----------------------------------------------------------
......@@ -164,9 +184,3 @@ set left_navbar_html "
</div>
<hr>
"
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -2,7 +2,7 @@ ad_page_contract {
Flush one or more values from util_memoize's cache
} {
suffix
{return_url "."}
{return_url:localurl "."}
}
if {$suffix eq "util_memoize"} {
......
......@@ -5,7 +5,7 @@ ad_page_contract {
pattern
raw_date
key:allhtml
{return_url "show-util-memoize?pattern=$pattern"}
{return_url:localurl "show-util-memoize?pattern=$pattern"}
}
if {[catch {set pair [ns_cache get util_memoize $key]} errmsg]} {
......
......@@ -21,7 +21,7 @@
<else>
<tr style="background-color:#f8f8ee">
</else>
<td><b>@caches.name@</b></td>
<td><strong>@caches.name@</strong></td>
<td align="right">@caches.entries@</td>
<td align="right">@caches.flushed@</td>
<td align="right">@caches.hit_rate@%</td>
......
......@@ -11,12 +11,12 @@
<input type="submit" value="Flush">
</form>
<hr>
<b>Key:</b>
<strong>Key:</strong>
<blockquote>
<pre>@key;noquote@</pre>
</blockquote>
<hr>
<b>Value:</b>
<strong>Value:</strong>
<blockquote>
@value;noquote@
</blockquote>
......
......@@ -2,7 +2,7 @@
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context;literal@</property>
Search for <b><code>@pattern@</code></b>:
Search for <strong><code>@pattern@</code></strong>:
<if @matches:rowcount@ not nil and @matches:rowcount@ gt 0>
@matches:rowcount@ matches found.<p></p>
......@@ -60,6 +60,6 @@
from the cache</a>-->
</if>
<else>
<i>no matches found</i>
<em>no matches found</em>
</else>
......@@ -46,28 +46,29 @@
<ul>
<li>
<b>Customize the front page</b>. Edit the files
<strong>Customize the front page</strong>. Edit the files
<code>@acs::rootdir@/www/index.adp</code> and
<code>@acs::rootdir@/www/index.tcl</code>. (<a
href="/doc/templates.html">More information</a>)
<code>@acs::rootdir@/www/index.tcl</code> (for more information, look into
<a href="/doc/templates.html" title="Using Templates in OpenACS">Using Templates in OpenACS</a>).
</li>
<li>Change the site's overall appearance by <b>editing the master template</b> that wraps every page. The master template is <code>@acs::rootdir@/www/default-master.adp</code>. An ADP file is almost like HTML, except with a few extra bells
and whistles (<a href="/doc/acs-templating/designer-guide.html"
title="Templating Designer's Guide">more information</a>).</li>
<li>Change the site's overall appearance by <strong>editing the master template</strong> that wraps every page. The master template is <code>@acs::rootdir@/www/default-master.adp</code>. An ADP file is almost like HTML, except with a few extra bells
and whistles (for more details, look into the <a href="/doc/acs-templating/designer-guide"
title="Templating Designer's Guide">Templating Designer's Guide</a>).</li>
<li><a href="/admin/" title="Package and User
administration">Site Administration</a>
<ul>
<li>Invite <a href="/acs-admin/users/">Users</a> or create <a href="/admin/groups/">Groups</a> (<a href="doc/permissions.html">More information</a>)</li>
<li><b>Download contributed packages</b> at the <a href="http://openacs.org/software/"
<li>Invite <a href="/acs-admin/users/">Users</a> or create <a href="/admin/groups/">Groups</a>
(for more information, see the documentation about <a href="/doc/permissions">Groups, Context and Permissions</a>)</li>
<li><strong>Download contributed packages</strong> at the <a href="http://openacs.org/software/"
title="Software Page on openacs.org">OpenACS Software Page</a>.</li>
<li><b>Install packages</b>. In addition to the Core packages,
<li><strong>Install packages</strong>. In addition to the Core packages,
which are already installed, OpenACS ships with many Standard
packages with additional functionality. Install these packages
with the <a href="/acs-admin/apm/" title="OpenACS Package Manager on your server">Package Manager</a>.</li>
<li>Use the <a href="/admin/site-map/"
title="The Site Map on your server">Site Map</a> to <b>mount and configure packages</b>. </li>
title="The Site Map on your server">Site Map</a> to <strong>mount and configure packages</strong>. </li>
</ul>
</ul>
......@@ -75,11 +76,11 @@
<h3>Learn More</h3>
<ul>
<li>OpenACS <a href="/doc/" title="Documentation Home on your
server"><b>Documentation</b></a> on this server.
server"><strong>Documentation</strong></a> on this server.
<li><a href="/api-doc/"
title="API Documentation">API documentation</a>.
</li>
<li>The home of the <b>OpenACS community</b> is
<li>The home of the <strong>OpenACS community</strong> is
at <a href="http://openacs.org/"
title="OpenACS Developer Community">http://openacs.org</a>.</li>
<li>Visit the <a href="http://openacs.org/forums/"
......@@ -88,7 +89,7 @@
href="http://openacs.org/forums/forum-view?forum_id=14013"
title="OpenACS discussion forum on openacs.org">OpenACS Q&amp;A
forum</a>.</li>
<li>Post <b>bugs</b> and <b>feature requests</b> in the <a href="http://openacs.org/bugtracker/openacs/"
<li>Post <strong>bugs</strong> and <strong>feature requests</strong> in the <a href="http://openacs.org/bugtracker/openacs/"
title="Software Development Manager on openacs.org">Bug
Tracker</a>.
</li>
......
......@@ -12,7 +12,7 @@
<p>Manage application packages with site-wide administration facilities.
These packages have either site-wide parameters (package
parameters valid for every instance of the package) or they have an
own web interface for site-wide administration (www/site-wide-admin).
own web interface for site-wide administration (www/sitewide-admin).
<listtemplate name="packages" style="table-2third"></listtemplate>
<p>
......
......@@ -8,19 +8,26 @@ ad_page_contract {
set page_title [ad_conn instance_name]
set package_keys '[join [subsite::package_keys] ',']'
set subsite_number [db_string count_subsites [subst {
select count(*) from apm_packages where package_key in ($package_keys)
select count(p.package_id) from apm_packages p, site_nodes s
where package_key in ($package_keys)
and s.object_id = p.package_id
}]]
db_multirow -extend { admin_url global_param_url } packages installed_packages {} {
set package_type [db_string get_package_type {
select package_type from apm_package_types
where package_key = :package_key
}]
if {
[apm_package_installed_p $package_key]
&& $package_type ne "apm_service"
&& [file exists "[acs_package_root_dir $package_key]/www/sitewide-admin/"]
} {
set admin_url "package/$package_key/"
} else {
set admin_url ""
}
if { [catch {db_1row global_params_exist {}} errmsg]
if { ![db_0or1row global_params_exist {}]
|| $global_params == 0
} {
set global_param_url ""
......
......@@ -21,8 +21,8 @@ away <br>and replaced by the chosen packages from the OpenACS respository.
custom code or your packages are kept in a local code repository.
<a href="/doc/upgrade-openacs-files">Help</a>.</p>
<p><a href="@local_install_url@" class="button">Install or upgrade</a>
from the local file system.</p>
<p><a href="@local_install_url@" class="button">Install</a> or
<a href="@local_upgrade_url@" class="button">upgrade</a> from the local file system.</p>
<li><h3>Install from URL or Local Path</h3>
<p>Load a single package an archive stored an a non-standard place on
......
......@@ -7,18 +7,18 @@ ad_page_contract {
set page_title "Install OpenACS Packages"
set context [list $page_title]
set local_install_url "[ad_conn package_url]/apm/packages-install"
set local_install_url [export_vars -base [ad_conn package_url]/apm/packages-install { {operation install} }]
set local_upgrade_url [export_vars -base [ad_conn package_url]/apm/packages-install { {operation upgrade} }]
set local_path $::acs::rootdir/packages
set remote_install_url [export_vars -base "install/install" { repository_url channel current_channel head_channel }]
set remote_upgrade_url [export_vars -base "install/install" { {upgrade_p 1} repository_url channel current_channel head_channel}]
ad_returnredirect "/acs-admin/apm/packages-install"
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
ad_returnredirect "/acs-admin/apm/packages-install"
......@@ -2,7 +2,7 @@
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context;literal@</property>
<if @problems_p@ true>
<if @problems_p;literal@ true>
<p> We're sorry. Some packages which are required in order to
install the packages you want could not be found. </p>
......@@ -24,10 +24,10 @@
<if @continue_url@ not nil>
<p>
&raquo; <a href="@continue_url@">Install above <if @install:rowcount@ eq 1>package</if><else>packages</else></a>
<a href="@continue_url@" class="button">Install above <if @install:rowcount@ eq 1>package</if><else>packages</else></a>
</p>
</if>
<if @problems_p@ true>
<if @problems_p;literal@ true>
<p> Please hit the Back button in your browser and go back and remove the packages we cannot install.</p>
......
......@@ -89,19 +89,32 @@ foreach package_key $install_order {
array unset version
array set version $repository($package_key)
if { ([info exists version(download_url)] && $version(download_url) ne "") } {
if { [info exists version(download_url)] && $version(download_url) ne "" } {
ns_write [subst {
<p>Transferring $version(download_url) ...
<script nonce='$::__csp_nonce'>window.scrollTo(0,document.body.scrollHeight);</script>
}]
set spec_file [apm_load_apm_file -url $version(download_url)]
if { $spec_file eq "" } {
ns_log Error "Error downloading package $package_key from $version(download_url). Installing package failed."
set msg "Error downloading package $package_key from $version(download_url). Installing package failed."
ns_write [subst {
<p>$msg
<script nonce='$::__csp_nonce'>window.scrollTo(0,document.body.scrollHeight);</script>
}]
ns_log Error $msg
set success_p 0
continue
}
ns_write [subst {
Done<br>
<script nonce='$::__csp_nonce'>window.scrollTo(0,document.body.scrollHeight);</script>
}]
set package_path "[apm_workspace_install_dir]/$package_key"
} else {
set spec_file $version(path)
set package_path "$::acs::rootdir/packages/$package_key"
}
set final_version_name $version(name)
if { [apm_package_version_installed_p $version(package.key) $version(name)] } {
......@@ -139,13 +152,15 @@ foreach package_key $install_order {
ns_write [subst {
<p>Installing $package_key ...<br>
<script>window.scrollTo(0,document.body.scrollHeight);</script>
<script nonce='$::__csp_nonce'>window.scrollTo(0,document.body.scrollHeight);</script>
}]
# Install the package -- this actually copies the files into the
# right place in the file system and backs up any old files
set version_id [apm_package_install \
-enable \
-install_from_repository \
-package_path $package_path \
-load_data_model \
-data_model_files $data_model_files \
......@@ -159,8 +174,58 @@ foreach package_key $install_order {
} else {
ns_write "... installation OK <br>\n"
}
if {$success_p} {
#
# The update has finished successfully. Since all the new
# files were sourced, the actual connection thread is already
# up to date. In order to provide this code to the other
# threads, it is necessary to update the internal
# blueprint. This works different in NaviServer and AOLserver,
# and is supported only by NaviServer for the time being.
#
# Other options:
#
# - run apm_package_install via "ns_eval": does not work,
# since "ns_eval" runs a script twice, a package can only
# be installed once.
#
# - run parts of apm_package_install: e.g. loading just the
# procs does not work, when it depends e.g. on package
# parameters, which have as well be updated in the
# blueprint.
#
# - fix the behavior in AOLserver
#
if {[info commands ::nstrace::statescript] ne ""} {
#
# NaviServer variant:
# - nstrace::statescript produces the blueprint
# - "ns_ictl save" updates it in the server
#
ns_ictl save [nstrace::statescript]
ns_write "... blueprint updated <br>\n"
} else {
#
# AOLserver: _ns_savenamespaces produces the update script
# and updates the blueprint, .... but it kills the
# internal state of the server. After running this
# command, e.g. all ns_sets are gone, later commands run
# into problems.
#
# _ns_savenamespaces
}
} else {
#
# At least one update has failed. Since it is not clear whether or
# not library files were sourced, it is necessary to delete this
# thread asap to avoid potential confusion with already updated
# procs.
#
ns_ictl markfordelete
}
ns_write {
<script>window.scrollTo(0,document.body.scrollHeight);</script>
<script nonce='$::__csp_nonce'>window.scrollTo(0,document.body.scrollHeight);</script>
}
}
......@@ -173,7 +238,6 @@ foreach package_key $install_order {
ad_progress_bar_end -url [export_vars -base install-4 { repository_url success_p }]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
......
......@@ -2,14 +2,16 @@
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context;literal@</property>
<p> Done installing packages. </p>
<h2>@page_title@</h2>
<if @success_p@ false>
<p> Unfortunately, we had some errors. Please check your server error log or contact your system administrator. </p>
<if @success_p;literal@ false>
<p>Unfortunately, we had some errors. Please check your server error log or contact your system administrator. </p>
</if>
<else>
<p> Done installing packages. </p>
<p>
<b>&raquo;</b> <a href="../server-restart">Click here to restart your server now</a>
<strong>&raquo;</strong> <a href="../server-restart" class="button">Click here</a> to restart your server now.
</p>
</else>
......@@ -5,7 +5,7 @@
<listfilters name="packages" style="inline-filters"></listfilters>
<if @packages:rowcount@ eq 0>
<if @upgrade_p@ true>
<if @upgrade_p;literal@ true>
<p> No packages on your system need upgrading. </p>
</if>
<else>
......@@ -21,4 +21,4 @@
<listtemplate name="packages"></listtemplate>
</else>
<p> <b>&raquo;</b> <a href=".">Go back to software installation</a>
<p> <strong>&raquo;</strong> <a href=".">Go back to software installation</a>
......@@ -16,7 +16,7 @@ if {$current_channel eq ""} {
set channel $current_channel
}
if {$head_channel eq ""} {
set head_channel [lindex [apm_get_repository_channels $repository_url] 0]
set head_channel [lindex [apm_get_repository_channels] 0 0]
}
#
......@@ -57,24 +57,44 @@ apm_get_installed_versions -array installed_versions
set upgrades_p 0
array set package [list]
if {$channel eq ""} {set channel $current_channel}
set fetch_url $repository_url/$channel/
if {$channel eq ""} {
set channel $current_channel
}
if {[regexp {^(.*/)(\d+-\d+)/$} $repository_url . base_url passed_in_channel]} {
#
# The passed in repository_url has already a channel
#
set fetch_url $repository_url
} else {
#
# The passed in repository_url has no channel
#
set base_url $repository_url
set fetch_url $base_url/$channel/
}
apm_get_package_repository -repository_url $fetch_url -array repository
if {$channel ne $current_channel} {
apm_get_package_repository -repository_url $base_url/$current_channel/ -array current_repository
}
foreach package_key [array names repository] {
set version $repository($package_key)
#
# Ignore the package in the following cases:
# - maturity is below specified level
# - package is deprecated
# - package is not supported by the installed database
# - don't offer "-portlet" alone (currently only useful in
# connection with DotLRN)
# - don't offer "-portlet" alone (currently only useful in connection with DotLRN)
# - dont't offer packages of HEAD, when these are included in the current channel
#
if {[dict get $version maturity] < $maturity
|| [dict get $version maturity] == 4
|| ![apm_package_supports_rdbms_p -package_key $package_key]
|| [string match "*-portlet" $package_key]
|| ($channel ne $current_channel && [info exists current_repository($package_key)])
} continue
if { $package_type eq "" || [dict get $version package.type] eq $package_type } {
......@@ -128,14 +148,17 @@ multirow -unclobber foreach packages {
set install_url [export_vars -base install-2 { package_key {repository_url $fetch_url}}]
}
set operation_label [expr {$upgrade_p ? "Upgrade" : "Install"}]
# Build the list-builder list
template::list::create \
-name packages \
-multirow packages \
-key package_key \
-bulk_actions {
"Install or upgrade checked applications" "install-2" "Install or upgrade checked applications"
} \
-bulk_actions [list \
"$operation_label checked applications" \
"install-2" \
"$operation_label checked applications" ] \
-bulk_action_export_vars {
{repository_url $fetch_url}
} \
......@@ -174,8 +197,8 @@ template::list::create \
channel {
label "Channel"
values {
{Current $current_channel}
{Head $head_channel}
{"$current_channel" $current_channel}
{"Supplemental" $head_channel}
}
default_value $current_channel
}
......@@ -183,10 +206,10 @@ template::list::create \
maturity {
label "Maturity at least"
values {
{New 0}
{Immature 1}
{Mature 2}
{"Mature and Standard" 3}
{"[_ acs-tcl.maturity_new_submission]" 0}
{"[_ acs-tcl.maturity_immature]" 1}
{"[_ acs-tcl.maturity_mature]" 2}
{"[_ acs-tcl.maturity_mature_and_standard]" 3}
}
default_value default_maturity
}
......
......@@ -65,10 +65,13 @@ template::list::create \
set distinct [array size ip_p]
# run standard Unix uptime command to get load average (crude measure of
# system health)
# run standard GNU uptime command to get load average (crude measure
# of system health).
if {[set uptime [util::which uptime]] eq ""} {
error "'uptime' command not found on the system"
}
if [catch { set uptime_output [exec /usr/bin/uptime] } errmsg] {
if {[catch { set uptime_output [exec $uptime] } errmsg]} {
# whoops something wrong with uptime (check path)
set uptime_output "ERROR running uptime, check path in script"
}
......
......@@ -5,3 +5,9 @@ set rest [join [lrange $urlv 2 end] "/"]
set file "[acs_package_root_dir $package_key]/www/sitewide-admin/$rest"
rp_internal_redirect -absolute_path $file
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -9,7 +9,7 @@ ad_page_contract {
email_from
subject
message
return_url
return_url:localurl
{show_sent_message_p:boolean "f"}
{sent_title "Email sent"}
{sent_subject "Email sent"}
......
<master>
<property name="doc(title)">@page_title;literal@</property>
<property name="context">@context;literal@</property>
<p> The server has been shut down. Normally, it should come back up by itself after a minute or so. </p>
<p> The server has been shut down.</p>
<p> If not, please check your server error log, or contact your system administrator. </p>
<p>When this OpenACS instance is installed as a service (recommended),
the server should come back up by itself after a minute or so. If
not, please check your server error log, or contact your system
administrator. </p>
<p>
Please wait for your server to get back up, then ...
Please wait for your server to get back up, or start the server again manually...
</p>
<p>
<b>&raquo;</b> <a href="/acs-admin/">Return to site-wide administration</a><br>
<b>&raquo;</b> <a href="/acs-admin/apm">Go to package manager</a>
<strong>&raquo;</strong> <a href="/acs-admin/">Return to site-wide administration</a><br>
<strong>&raquo;</strong> <a href="/acs-admin/apm">Go to package manager</a>
</p>
......@@ -8,26 +8,27 @@ ad_page_contract {
}
set page_title "Restarting Server"
set context [list $page_title]
# We do this as a schedule proc, so the server will have time to serve the page
global tcl_platform
set platform $tcl_platform(platform)
switch $platform {
"windows" {
# Restart doesn't work on Windows services, so handle it here...
ad_schedule_proc -thread t -once t 2 ns_shutdown -restart
}
default {
# Don't modify default behavior.
# Trust Linux to handle restarts
ad_schedule_proc -thread t -once t 2 ns_shutdown
}
#
# When using NaviServer, and when the kernel parameter
# "NsShutdownWithNonZeroExitCode" is set to be true, the "-restart"
# option will be used.
#
if {[ns_info name] eq "NaviServer" &&
[parameter::get -parameter NsShutdownWithNonZeroExitCode -package_id [ad_acs_kernel_id] -default 0]
} {
set cmd {ns_shutdown -restart}
} else {
set cmd ns_shutdown
}
#
# We perform the shutdown as a scheduled proc, so the server will have
# time to serve the page.
#
ad_schedule_proc -thread t -once t 2 {*}$cmd
# Local variables:
# mode: tcl
# tcl-indent-level: 4
......
......@@ -18,12 +18,14 @@ if {$subsite_number > 500} {
} else {
set too_many_subsites_p 0
db_multirow -extend { admin_url path_pretty parameter_url} subsites subsite_admin_urls {} {
db_multirow -extend { theme theme_url admin_url path_pretty parameter_url} subsites subsite_admin_urls {} {
set admin_url "${node_url}admin/"
set parameter_url [export_vars -base /shared/parameters {package_id {return_url "[ad_conn url]"}}]
set path_pretty $instance_name
array set node [site_node::get -node_id $node_id]
set parent_id $node(parent_id)
set theme [parameter::get -parameter ThemeKey -package_id $package_id]
set theme_url ${admin_url}themes/
while { $parent_id ne "" } {
array unset node
......@@ -49,7 +51,12 @@ if {$subsite_number > 500} {
display_template {\#acs-admin.Pages#}
html {align left}
}
theme {
label "Theme"
link_url_col theme_url
html {align left}
}
admin_url {
label "Subsite Administration"
link_html { title "Subsite Administration" }
......
......@@ -13,7 +13,7 @@
</multiple>
</ul>
</if><else>
for users matching <b> @combine_method@ </b> of the criteria:
for users matching <strong> @combine_method@ </strong> of the criteria:
<ul>
<multiple name="criteria">
<li> @criteria.data@ </li>
......@@ -43,7 +43,7 @@
<if @user_search:rowcount@ gt 30>
<if @only_authorized_p@ eq 0>
<if @only_authorized_p;literal@ false>
<p>
We're showing all users, authorized or not (<a href="complex-search?@export_authorize@&amp;only_authorized_p=1">
show only authorized</a>).
......
......@@ -103,8 +103,11 @@ set rowcount 0
if {$limit_to_users_in_group_id ne ""
&& ![regexp {[^-0-9]} $limit_to_users_in_group_id] } {
set group_name [db_string user_group_name_from_id \
"select group_name from groups where group_id = :limit_to_users_in_group_id"]
set group_name [db_string user_group_name_from_id {
select group_name
from groups
where group_id = :limit_to_users_in_group_id
}]
incr rowcount
set criteria:[set rowcount](data) \
"Is a member of '$group_name'"
......@@ -194,16 +197,18 @@ set criteria:rowcount $rowcount
if { $limit_to_users_in_group_id ne "" } {
set query "select distinct first_names, last_name, email, member_state, email_verified_p, cu.user_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
where (cu.user_id = gm.member_id
and gm.group_id = :limit_to_users_in_group_id)"
and gm.group_id = :limit_to_users_in_group_id)
}
if {[llength $where_clause] > 0} {
append query \
"\n$where_conjunction [join $where_clause "\n$where_conjunction "]"
}
} else {
set query "select user_id, email_verified_p, first_names, last_name, email, member_state from cc_users"
set query {select user_id, email_verified_p, first_names, last_name, email, member_state from cc_users}
if {[llength $where_clause] > 0} {
append query "\nwhere [join $where_clause "\n$where_conjunction "]"
}
......@@ -224,14 +229,16 @@ db_foreach user_search_admin $query {
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
set user_search:[set rowcount](export_vars) [export_vars {user_id_from_search first_names_from_search last_name_from_search email_from_search}]
set user_search:[set rowcount](export_vars) [export_vars {
user_id_from_search first_names_from_search last_name_from_search email_from_search
}]
set user_search:[set rowcount](member_state) $member_state
if { $member_state ne "approved" } {
set user_search:[set rowcount](user_finite_state_links) \
[join [ad_registration_finite_state_machine_admin_links \
$member_state $email_verified_p $user_id_from_search \
[export_vars -base complex-search {
[export_vars -base /acs-admin/users/complex-search {
email last_name keyword target passthrough limit_to_users_in_group_id only_authorized_p
}]] " | "]
} else {
......
......@@ -6,7 +6,7 @@ ad_page_contract {
@cvs-id $Id$
} {
user_id:naturalnum,notnull
{return_url .}
{return_url:localurl .}
{permanent:boolean f}
}
......
......@@ -15,49 +15,9 @@
</querytext>
</fullquery>
<fullquery name="member_approve">
<querytext>
begin membership_rel.approve( rel_id => :rel_id ); end;
</querytext>
</fullquery>
<fullquery name="member_ban">
<querytext>
begin membership_rel.ban( rel_id => :rel_id ); end;
</querytext>
</fullquery>
<fullquery name="member_reject">
<querytext>
begin membership_rel.reject( rel_id => :rel_id ); end;
</querytext>
</fullquery>
<fullquery name="member_deleted">
<querytext>
begin membership_rel.del( rel_id => :rel_id ); end;
</querytext>
</fullquery>
<fullquery name="member_unapprove">
<querytext>
begin membership_rel.unapprove( rel_id => :rel_id ); end;
</querytext>
</fullquery>
<fullquery name="approve_email">
<querytext>
begin acs_user.approve_email ( user_id => :user_id ); end;
</querytext>
</fullquery>
......@@ -65,7 +25,6 @@
<fullquery name="unapprove_email">
<querytext>
begin acs_user.unapprove_email ( user_id => :user_id ); end;
</querytext>
</fullquery>
......
......@@ -8,9 +8,15 @@ ad_page_contract {
} {
user_id:naturalnum,notnull
{member_state "no_change"}
{email_verified_p:boolean "no_change"}
{return_url ""}
{member_state:trim}
{email_verified_p:boolean ""}
{return_url:localurl ""}
} -validate {
valid_member_state -requires member_state {
if {$member_state ni {approved banned deleted merged "needs approval" rejected}} {
ad_complain "invalid member_state '$member_state'"
}
}
} -properties {
context:onevalue
export_vars:onevalue
......@@ -24,45 +30,34 @@ if {![db_0or1row get_states {}]} {
return
}
set action ""
switch $member_state {
"approved" {
set action "Approve $name"
set email_message "Your membership in [ad_system_name] has been approved. Please return to [ad_url]."
}
"banned" {
set action "Ban $name"
set email_message "You have been banned from [ad_system_name]."
}
"rejected" {
set action "Reject $name"
set email_message "Your account have been rejected from [ad_system_name]."
}
"deleted" {
set action "Delete $name"
set email_message "Your account have been deleted from [ad_system_name]."
}
"needs approval" {
set action "Require Admin Approval for $name"
set email_message "Your account at [ad_system_name] is awaiting approval from an administrator."
}
}
#
# This page is used for state changes in the member_state, and as well
# on email confirm require and approve operations.
#
switch $email_verified_p {
"t" {
set action "Approve Email for $name"
set email_message "Your email in [ad_system_name] has been approved. Please return to [ad_url]."
set user_name $name
set url [ad_url]
set site_name [ad_system_name]
set action [lang::util::localize #acs-kernel.email_action_approved#]
set email_message [lang::util::localize #acs-kernel.email_mail_approved#]
}
"f" {
set action "Require Email from $name"
set email_message "Your email in [ad_system_name] needs approval. please go to [ad_url]/register/email-confirm"
set user_name $name
set url [ad_url]/register/email-confirm
set site_name [ad_system_name]
set action [lang::util::localize #acs-kernel.email_action_needs_approval#]
set email_message [lang::util::localize #acs-kernel.email_mail_needs_approval#]
}
default {
set action [group::get_member_state_pretty -component action \
-member_state $member_state \
-user_name $name]
set email_message [group::get_member_state_pretty -component account_mail \
-member_state $member_state \
-site_name [ad_system_name] \
-url [ad_url]]
}
}
if {$action eq ""} {
ad_return_complaint 1 "Not valid action: You have not changed the user in any way"
return
}
if {[catch {
......@@ -70,12 +65,10 @@ if {[catch {
switch $email_verified_p {
"t" {
db_exec_plsql approve_email "
begin acs_user.approve_email ( user_id => :user_id ); end;"
db_exec_plsql approve_email {}
}
"f" {
db_exec_plsql unapprove_email "
begin acs_user.unapprove_email ( user_id => :user_id ); end;"
db_exec_plsql unapprove_email {}
}
}
} errmsg]} {
......@@ -86,15 +79,12 @@ if {[catch {
callback acs_admin::member_state_change -member_state $member_state -user_id $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 email_from [db_string admin_email {select email from parties where party_id = :admin_user_id}]
set subject $action
set message $email_message
if {$return_url eq ""} {
set return_url [export_vars -base /acs-admin/users/one {user_id}]
} else {
ad_returnredirect $return_url
ad_script_abort
}
set context [list [list "./" "Users"] "$action"]
......
......@@ -6,11 +6,11 @@
<center>
<p/>
<b>
<strong>
The user @from_first_names@ @from_last_name@ (@from_email@) will be deleted.
<b/>
</strong>
<p/>
<b style="color:red">
<strong style="color:red">
These accounts will be merged and the <u>good and final account</u> will be:
<p/>
......@@ -19,9 +19,9 @@
<span style="font-size:14pt;">@to_first_names@ @to_last_name@ (@to_email@)</span>
<p/>
</b>
</strong>
<p/>
<b>WARNING:</b> Are you are absolutely sure to merge these accounts?
<strong>WARNING:</strong> Are you are absolutely sure to merge these accounts?
<p/>
<form action=merge-final method=get>
<table>
......
......@@ -12,8 +12,8 @@ ad_page_contract {
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"]
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 { $from_authority_id ne $to_authority_id } {
ad_complain "Merge only works for users from the same authority"
}
......@@ -33,14 +33,14 @@ set context [list [list "./" "Merge"] "Merge"]
# information of from_user_id
db_1row from_get_info { *SQL* }
db_1row from_get_info {}
# information of to_user_id
db_1row to_get_info { *SQL* }
db_1row to_get_info {}
# information of user_id one
if { [db_0or1row to_user_portrait { *SQL* }] } {
if { [db_0or1row to_user_portrait {}] } {
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"
......
......@@ -12,8 +12,8 @@ ad_page_contract {
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"]
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 { $from_authority_id ne $to_authority_id } {
ad_complain "Merge only works for users of the same authority"
}
......@@ -32,8 +32,9 @@ 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 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>"
......@@ -46,7 +47,9 @@ if { !$merge_p } {
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 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 \
......
......@@ -16,27 +16,27 @@
<tr>
<td>
<center>
<b>ACCOUNT ONE</b>
<strong>ACCOUNT ONE</strong>
<p/>
<img style="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>
<h3>General Information of user one (<strong>@one_email@</strong>):</h3>
</center>
<ul>
<li>
Name:
<i>@one_first_names@ @one_last_name@</i>
<em>@one_first_names@ @one_last_name@</em>
</li>
<li>
Email:
<b><a href="mailto:@one_email@">@one_email@</a></b>
<strong><a href="mailto:@one_email@">@one_email@</a></strong>
</li>
<li>
Scren name:
<b>@one_screen_name@</b>
<strong>@one_screen_name@</strong>
</li>
<li>
Username:
<b>@one_username@</b>
<strong>@one_username@</strong>
</li>
<li>
User id:
......@@ -80,7 +80,7 @@
</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>)
(<a id="toggle-footer-display-control-1" href="#" class="off" title="Toggle Footer display">more information</a>)
</center>
<div class="um-adp-box-off">
<div class="um-more-info-off">
......@@ -109,7 +109,7 @@
<tr>
<td>
<center>
<b>Which is the good account?</b>
<strong>Which is the good account?</strong>
<p/>
<input type="radio" name="merge_action" value="0">
<img src="/resources/acs-admin/left.gif" alt="left one">
......@@ -145,27 +145,27 @@
<tr>
<td>
<center>
<b>ACCOUNT TWO</b>
<strong>ACCOUNT TWO</strong>
<p/>
<img style="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>
<h3>General Information of user two (<strong>@two_email@</strong>):</h3>
</center>
<ul>
<li>
Name:
<i>@two_first_names@ @two_last_name@</i>
<em>@two_first_names@ @two_last_name@</em>
</li>
<li>
Email:
<b><a href="mailto:@two_email@">@two_email@</a></b>
<strong><a href="mailto:@two_email@">@two_email@</a></strong>
</li>
<li>
Scren name:
<b>@two_screen_name@</b>
<strong>@two_screen_name@</strong>
</li>
<li>
Username:
<b>@two_username@</b>
<strong>@two_username@</strong>
</li>
<li>
User id:
......@@ -209,7 +209,7 @@
</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>)
(<a id="toggle-footer-display-control-2" href="#" class="off" title="Toggle Footer display">more information</a>)
</center>
<div class="um-adp-box-off2">
<div class="um-more-info-off2">
......
......@@ -26,13 +26,13 @@ set context [list [list "./" "Merge"] "Merge"]
#
# Information of user_id_one
#
if { [db_0or1row one_user_portrait { *SQL* }] } {
if { [db_0or1row one_user_portrait {}] } {
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_1row one_get_info {}
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]"
......@@ -57,13 +57,13 @@ if { $user_id_one_items ne "" } {
#
# Information of user_id_two
#
if { [db_0or1row two_user_portrait { *SQL* }] } {
if { [db_0or1row two_user_portrait {}] } {
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_1row two_get_info {}
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]"
......@@ -89,6 +89,24 @@ template::head::add_css \
-href "/resources/acs-admin/um-more-info.css" \
-media all
template::add_body_script -script {
function toggle_footer(event) {
event.preventDefault();
var el = document.getElementsByTagName('div');
for(i = 0; i < el.length; i++) {
if (el[i].className=='um-more-info') {
el[i].className='um-more-info-off';
} else {
if (el[i].className=='um-more-info-off') {
el[i].className='um-more-info';
}
}
};
return false;
};
document.getElementById('toggle-footer-display-control-1').addEventListener('click', toggle_footer, false);
document.getElementById('toggle-footer-display-control-2').addEventListener('click', toggle_footer, false);
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
......
......@@ -3,24 +3,6 @@
<queryset>
<rdbms><type>oracle</type><version>8.1.6</version></rdbms>
<fullquery name="user_info">
<querytext>
select first_names,
last_name,
username,
email,
nvl(screen_name,'&lt; none set up &gt;') as screen_name,
creation_date,
creation_ip,
to_char(last_visit, 'YYYY-MM-DD HH24:MI:SS') as last_visit_ansi,
member_state,
email_verified_p,
url
from cc_users
where user_id = :user_id
</querytext>
</fullquery>
<fullquery name="get_item_id">
<querytext>
select live_revision as revision_id, nvl(title,'view this portrait') portrait_title
......
......@@ -10,8 +10,8 @@
<li>User ID: @user_id;literal@</li>
<li><a href="@user_info.url;noi18n@">View community member page</a></li>
<li>Registration date: @user_info.creation_date_pretty@</li>
<li>Registration IP: @user_info.creation_ip@ (<a href="@user_info.by_ip_url@" title="Other registrations from this IP address">others</a>)</li>
<li>Last visit: @user_info.last_visit_pretty@</li>
<li>Registration IP: <a href="./ip-info?ip=@user_info.creation_ip@">@user_info.creation_ip@</a> (<a href="@user_info.by_ip_url@" title="Other registrations from this IP address">others</a>)</li>
<li>Last visit: @user_info.last_visit_pretty@ from </li>
<if @portrait_url@ not nil>
......@@ -20,17 +20,17 @@
</ul>
<if @user_id;literal@ ne @ad_conn_user_id;literal@>
<if @warning_p@>
<if @warning_p;literal@ true>
<p>
<b>WARNING:</b> This user is a site-wide administrator (maybe the only one).
<strong>WARNING:</strong> This user is a site-wide administrator (maybe the only one).
Deleting or banning this user may mean you will be unable to administrate the site.
</p>
</if>
<p>Member state: <b>@user_info.member_state@</b> - change member state: @user_finite_state_links;noquote@<br>
<p>Member state: <strong>@user_info.member_state@</strong> - change member state: @user_finite_state_links;noquote@<br>
Delete user: <a href="@delete_user_url@">temporarily</a>, <a href="@delete_user_permanent_url@">permanently</a></p>
</if>
<else>
<p>Member state: <b>@user_info.member_state@</b> <i>(cannot change state for yourself)</i></p>
<p>Member state: <strong>@user_info.member_state@</strong> <em>(cannot change state for yourself)</em></p>
</else>
<h2>This user is a member of the following groups:</h2>
......@@ -70,7 +70,7 @@ above.
<h2>Administrative Actions</h2>
<ul>
<if @site_wide_admin_p@ true>
<if @site_wide_admin_p;literal@ true>
<li><a href="@modify_admin_url;noi18n@">Revoke site-wide administration privileges</a></li>
</if>
<else>
......
......@@ -23,7 +23,7 @@ set user_info(by_ip_url) [export_vars -base "complex-search" { { target one } {
set return_url [ad_return_url]
set delete_user_url [export_vars -base delete-user { user_id return_url {permanent f}}]
set delete_user_permanent_url [export_vars -base delete-user { user_id return_url {permanent t}}]
set delete_user_permanent_url [export_vars -base delete-user { user_id {return_url /acs-admin/users} {permanent t}}]
#
# RBM: Check if the requested user is a site-wide admin and warn the
......@@ -35,7 +35,7 @@ set warning_p 0
set ad_conn_user_id [ad_conn user_id]
#
# Define the url for switching side-wide admin priviledges with a timeout of 60 seconds
# Define the url for switching side-wide admin privileges with a timeout of 60 seconds
#
if { $site_wide_admin_p } {
set modify_admin_url [export_vars -base modify-admin-privileges {user_id:sign(max_age=60) {action:sign revoke}}]
......@@ -47,25 +47,16 @@ if { $site_wide_admin_p } {
set context [list [list "./" "Users"] "One User"]
if {[db_0or1row get_item_id "select live_revision as revision_id, nvl(title,'view this portrait') portrait_title
from acs_rels a, cr_items c, cr_revisions cr
where a.object_id_two = c.item_id
and c.live_revision = cr.revision_id
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel'"]} {
if {[db_0or1row get_item_id {}]} {
set portrait_url [export_vars -base /shared/portrait { user_id }]
}
set user_finite_state_links "[join [ad_registration_finite_state_machine_admin_links $user_info(member_state) $user_info(email_verified_p) $user_id] " | "]"
set user_finite_state_links [join [ad_registration_finite_state_machine_admin_links $user_info(member_state) $user_info(email_verified_p) $user_id] " | "]
# XXX Make sure to make the following into links and this looks okay
db_multirow user_contributions user_contributions "select at.pretty_name, at.pretty_plural, a.creation_date, acs_object.name(a.object_id) 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 object_name, creation_date"
db_multirow user_contributions user_contributions {}
# cro@ncacasi.org 2002-02-20
# Boy is this query wacked, but I think I am starting to understand
......@@ -73,26 +64,16 @@ order by object_name, creation_date"
# Find out which groups this user belongs to where he was added to the group
# directly (e.g. his membership is not by virtue of the group being
# a component of another group).
db_multirow direct_group_membership direct_group_membership "
select group_id, rel_id, party_names.party_name as group_name
from (select /*+ ORDERED */ DISTINCT rels.rel_id, object_id_one as group_id,
object_id_two
from acs_rels rels, all_object_party_privilege_map perm
where perm.object_id = rels.rel_id
and perm.privilege = 'read'
and rels.rel_type = 'membership_rel'
and rels.object_id_two = :user_id) r,
party_names
where r.group_id = party_names.party_id
order by lower(party_names.party_name)"
db_multirow direct_group_membership direct_group_membership {}
# And also get the list of all groups he is a member of, direct or
# inherited.
db_multirow all_group_membership all_group_membership "
db_multirow all_group_membership all_group_membership {
select groups.group_id, groups.group_name
from groups, group_member_map gm
where groups.group_id = gm.group_id and gm.member_id=:user_id
order by lower(groups.group_name)"
from groups, group_member_map gm
where groups.group_id = gm.group_id and gm.member_id=:user_id
order by lower(groups.group_name)
}
if { [auth::password::can_reset_p -authority_id $user_info(authority_id)] } {
set password_reset_url [export_vars -base "password-reset" { user_id return_url }]
......@@ -104,9 +85,6 @@ set portrait_manage_url [export_vars -base /user/portrait/ { user_id return_url
ad_return_template
# Local variables:
# mode: tcl
# tcl-indent-level: 4
......
......@@ -2,7 +2,7 @@ ad_page_contract {
Reset a user's password.
} {
user_id:naturalnum,notnull
{return_url .}
{return_url:localurl .}
}
acs_user::get -user_id $user_id -array user_info
......
......@@ -4,7 +4,7 @@ ad_page_contract {
@version $Id$
} {
{user_id:naturalnum,notnull}
{return_url ""}
{return_url:localurl ""}
{password_old ""}
}
......
......@@ -14,17 +14,7 @@ set context [list [list "./" "Users"] "Registration History"]
# we have to query for pretty month and year separately because Oracle pads
# month with spaces that we need to trim
db_multirow user_rows user_rows {
select to_char(creation_date,'YYYYMM') as sort_key,
rtrim(to_char(creation_date,'Month')) as pretty_month,
to_char(creation_date,'YYYY') as pretty_year,
count(*) as n_new
from users, acs_objects
where users.user_id = acs_objects.object_id
and creation_date is not null
group by to_char(creation_date,'YYYYMM'), to_char(creation_date,'Month'), to_char(creation_date,'YYYY')
order by 1
}
db_multirow user_rows user_rows {}
ad_return_template
......
......@@ -12,14 +12,14 @@
</else></else>
<if @only_authorized_p@ false>
<if @only_authorized_p;literal@ false>
<p>
<b>Show</b> | <a href="search?@export_authorize@&amp;only_authorized_p=1">Hide</a> unapproved users.
<strong>Show</strong> | <a href="search?@export_authorize@&amp;only_authorized_p=1">Hide</a> unapproved users.
</p>
</if>
<else>
<p>
<a href="search?@export_authorize@&amp;only_authorized_p=0">Show</a> | <b>Hide</b> unapproved users.
<a href="search?@export_authorize@&amp;only_authorized_p=0">Show</a> | <strong>Hide</strong> unapproved users.
</p>
</else>
......
......@@ -101,7 +101,7 @@ if { $only_authorized_p } {
if { ![info exists passthrough] } {
set passthrough_parameters ""
} else {
set passthrough_parameters "[export_entire_form_as_url_vars $passthrough]"
set passthrough_parameters [export_entire_form_as_url_vars $passthrough]
}
if { $limit_to_user_id ne "" } {
......@@ -110,17 +110,21 @@ if { $limit_to_user_id ne "" } {
}
if { $limit_to_users_in_group_id ne "" } {
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
where cu.user_id = gm.member_id
and gm.rel_id = mr.rel_id
and gm.group_id = :limit_to_users_in_group_id
and [join $where_clause "\nand "]"
set query [subst {
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
where cu.user_id = gm.member_id
and gm.rel_id = mr.rel_id
and gm.group_id = :limit_to_users_in_group_id
and [join $where_clause "\nand "]
}]
} else {
set query "select user_id, email_verified_p, first_names, last_name, email, member_state
from cc_users
where [join $where_clause "\nand "]"
set query [subst {
select user_id, email_verified_p, first_names, last_name, email, member_state
from cc_users
where [join $where_clause "\nand "]
}]
}
......@@ -163,8 +167,11 @@ set user_search:rowcount $rowcount
# We are limiting the search to one group - display that group's name
if { $limit_to_users_in_group_id ne ""
&& ![regexp {[^0-9]} $limit_to_users_in_group_id] } {
set group_name [db_string user_group_name_from_id \
"select group_name from user_groups where group_id = :limit_to_users_in_group_id"]
set group_name [db_string user_group_name_from_id {
select group_name from
user_groups
where group_id = :limit_to_users_in_group_id
}]
set title "User search in $group_name"
} else {
set group_name ""
......
......@@ -22,10 +22,16 @@ append whole_page "[ad_admin_header "Session History"]
# we have to query for pretty month and year separately because Oracle pads
# month with spaces that we need to trim
set selection [ns_db select $db "select to_char(entry_date,'YYYYMM') as sort_key, rtrim(to_char(entry_date,'Month')) as pretty_month, to_char(entry_date,'YYYY') as pretty_year, sum(session_count) as total_sessions, sum(repeat_count) as total_repeats
from session_statistics
group by to_char(entry_date,'YYYYMM'), to_char(entry_date,'Month'), to_char(entry_date,'YYYY')
order by 1"]
set selection [ns_db select $db {
select to_char(entry_date,'YYYYMM') as sort_key,
rtrim(to_char(entry_date,'Month')) as pretty_month,
to_char(entry_date,'YYYY') as pretty_year,
sum(session_count) as total_sessions,
sum(repeat_count) as total_repeats
from session_statistics
group by to_char(entry_date,'YYYYMM'), to_char(entry_date,'Month'), to_char(entry_date,'YYYY')
order by 1
}]
set last_year ""
while { [ns_db getrow $db $selection] } {
......
......@@ -23,15 +23,13 @@ append whole_page "[ad_admin_header "Sessions in $pretty_month, $pretty_year"]
"
set selection [ns_db select $db "select
entry_date,
to_char(entry_date,'fmDD') as day_number,
session_count,
repeat_count
from session_statistics
where rtrim(to_char(entry_date,'Month')) = '$QQpretty_month'
and to_char(entry_date,'YYYY') = '$QQpretty_year'
order by entry_date"]
set selection [ns_db select $db {
select entry_date, to_char(entry_date,'fmDD') as day_number, session_count, repeat_count
from session_statistics
where rtrim(to_char(entry_date,'Month')) = '$QQpretty_month'
and to_char(entry_date,'YYYY') = '$QQpretty_year'
order by entry_date
}]
while { [ns_db getrow $db $selection] } {
set_variables_after_query
......
......@@ -33,11 +33,13 @@ append whole_page "[ad_admin_header "Registered Sessions"]
# we have to query for pretty month and year separately because Oracle pads
# month with spaces that we need to trim
set selection [ns_db select $db "select round(sysdate-last_visit) as n_days, count(*) as n_sessions, count(second_to_last_visit) as n_repeats
from users
where last_visit is not null
group by round(sysdate-last_visit)
order by 1"]
set selection [ns_db select $db {
select round(sysdate-last_visit) as n_days, count(*) as n_sessions, count(second_to_last_visit) as n_repeats
from users
where last_visit is not null
group by round(sysdate-last_visit)
order by 1
}]
set table_rows ""
......
......@@ -2,7 +2,7 @@ ad_page_contract {
Processes a new user created by an admin
@cvs-id $Id$
} -query {
user_id
user_id:naturalnum,notnull
password
{referer "/acs-admin/users"}
} -properties {
......@@ -30,8 +30,11 @@ if { $password eq "" } {
set password [ad_generate_random_string]
}
set administration_name [db_string admin_name "select
first_names || ' ' || last_name from persons where person_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]
......
......@@ -7,7 +7,7 @@ ad_page_contract {
message
first_names
last_name
user_id
user_id:naturalnum,notnull
{referer "/acs-admin/users"}
} -properties {
context:onevalue
......
......@@ -3,5 +3,5 @@
<property name="focus">register.email</property>
<property name="context">@context;literal@</property>
<include src="@user_new_template;literal@" next_url="@next_url;literal@" self_register_p="0"/>
<include src="@user_new_template;literal@" next_url="@next_url;literal@" self_register_p="0">
......@@ -35,8 +35,11 @@ while {[regexp {(.[^\n]+)} $userlist match_fodder row] } {
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)"]
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"
......
......@@ -10,8 +10,12 @@ ad_page_contract {
}
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 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]
......
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