Index: openacs-4/packages/quota/quota.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/quota.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/quota.info 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,46 @@ + + + + + Quota + Quota + f + f + quota + + + Paco Soler + Agustin Lopez + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/quota/catalog/quota.ca_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/catalog/quota.ca_ES.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/catalog/quota.ca_ES.ISO-8859-1.xml 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,52 @@ + + + + Tornar + Comunitat + Detalls de la Comunitat + Crear-se-la + Eliminar quota + QUOTA DETALLADA DE LA COMUNITAT + QUOTA D'USUARI DETALLADA + N� Arxius + QUOTA GLOBAL + Quota Global (KB) + N� m�xim d'arxius per comunitat + N� m�xim d'arxius per usuari + N� m�xim d'arxius per usuari en una comunitat + N� m�xim d'arxius per directori personal + Quota m�xima per comunitat (en KB) + Quota m�xima per usuari (en KB) + Quota m�xima per usuari en una comunitat (en KB) + Quota m�xima del directori personal de l'usuari (en KB) + Nom + Administrador exempt de quotes + PAR�METRES + Arxius Personals + QUOTA DIRECTORI PERSONAL + Quota Personal (KB) + Quota + Gestionar Quotes + QUOTA PER COMMUNITAT + QUOTA PER USUARI + N� Fitxers + Quota (KB) + El CONTROL DE QUOTES est� desactivat + El CONTROL DE QUOTES est� activat + (Desactivar) + (Activar) + Disponible + Guardar Canvis + Cercar + Selecciona Comunitat + Selecciona Usuari + Total + Utilitzat + Quota utilitzada (KB) + Usuari + Detalls d'usuari + L'Usuari t� quota + L'Usuari no t� quota + QUOTA D'USUARI PER COMUNITATS + Nom d'Usuari + Index: openacs-4/packages/quota/catalog/quota.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/catalog/quota.en_US.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/catalog/quota.en_US.ISO-8859-1.xml 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,52 @@ + + + + Back + Community + Community Details + Create user quota + Delete quota + DETAILED COMMUNITY QUOTA + DETAILED USER QUOTA + Global Files + GLOBAL QUOTA + Global Quota (KB) + Max. Number of files in a community + Max. number of files by user + Max. number of files by user-community + Max. number of files by user personal folder + Max. quota used by a community (in KB) + Max. quota used by user (in KB) + Max. quota used by user-community (in KB) + Max. quota used by user personal folder (in KB) + Name + No quota for Site Admin + PARAMETERS + Personal Files + PERSONAL FOLDER QUOTA + Personal Quota (KB) + Quota + Manage Quota + QUOTA BY COMMUNITY + QUOTA BY USER + N� Files + Quota (KB) + QUOTA CONTROL is currently off + QUOTA CONTROL is currently on + (turn it off) + (turn it on) + Available + Save Changes + Search + Select Community + Select User + Total + Used + Used Quota (KB) + User + User Details + User has quota + User hasn't quota + USER QUOTA BY COMMUNITY + Username + Index: openacs-4/packages/quota/catalog/quota.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/catalog/quota.es_ES.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/catalog/quota.es_ES.ISO-8859-1.xml 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,52 @@ + + + + Volver + Comunidad + Detalles de la Comunidad + Cre�rsela + Eliminar cuota + CUOTA DETALLADA DE LA COMUNIDAD + CUOTA DE USUARIO DETALLADA + N� Archivos + CUOTA GLOBAL + Cuota Global (KB) + N� m�ximo de archivos por comunidad + N� m�ximo de archivos por usuario + N� m�ximo de archivos por usuario en una comunidad + N� m�ximo de archivos por directorio personal + Cuota m�xima por comunidad (en KB) + Cuota m�xima por usuario (en KB) + Cuota m�xima por usuario en una comunidad (en KB) + Cuota m�xima del directorio personal del usuario (en KB) + Nombre + Administrador exento de cuota + PAR�METROS + Archivos Personales + CUOTA DIRECTORIO PERSONAL + Cuota Personal (KB) + Quota + Gestionar Cuotas + CUOTA POR COMUNIDAD + CUOTA POR USUARIO + N� Archivos + Cuota (KB) + El CONTROL DE CUOTAS est� desactivado + El CONTROL DE CUOTAS est� activado + (Desactivar) + (Activar) + Disponible + Guardar Cambios + Buscar + Selecciona Communidad + Selecciona Usuario + Total + Usado + Cuota utilizada (KB) + Usuario + Detalles del usuario + El usuario tiene cuota + El usuario no tiene cuota + CUOTA DE USUARIO POR COMUNIDADES + Nombre de Usuario + Index: openacs-4/packages/quota/sql/postgresql/quota-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/sql/postgresql/quota-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/sql/postgresql/quota-create.sql 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,40 @@ +-- +-- Copyright (C) 2004 University of Valencia +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- +-- +-- QUOTA TABLES CREATE +-- +-- @author Paco Soler (fransola@uv.es) +-- @author Agustin Lopez (Agustin.Lopez@uv.es) +-- @creation-date 2005-12-15 +-- @version $Id: quota-portlet-drop.sql,v 0.2 2005-12-15 + + +-- TABLES ------------------------------------------------------------- + +-- TABLE USER_QUOTA ------------------------------------------------------------- +create sequence user_quota_sequence start 1; +create table user_quota ( + quota_id integer primary key default nextval('user_quota_sequence'), + ref_user integer not null, + global_quota integer not null, + global_files integer not null, + personal_quota integer not null, + personal_files integer not null, + usercomm_actv boolean default true, + constraint ref_user_id_fk foreign key (ref_user) references users (user_id) +); +create index user_quota_idx on user_quota (ref_user); + Index: openacs-4/packages/quota/sql/postgresql/quota-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/sql/postgresql/quota-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/sql/postgresql/quota-drop.sql 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,30 @@ +-- +-- Copyright (C) 2004 University of Valencia +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- +-- +-- QUOTA DROP TABLES +-- +-- @author Paco Soler (fransola@uv.es) +-- @author Agustin Lopez (Agustin.Lopez@uv.es) +-- @creation-date 2005-12-15 +-- @version $Id: quota-portlet-drop.sql,v 0.2 2005-12-15 + + +--Drop data +drop sequence user_quota_sequence; +drop index user_quota_idx; +drop table user_quota; + + Index: openacs-4/packages/quota/tcl/quota-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/tcl/quota-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/tcl/quota-procs.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,428 @@ +ad_library { + TCL library for the quota system + + @author Paco Soler (fransola@uv.es) + @author Agustin Lopez (Agustin.Lopez@uv.es) + @creation-date 15 December 2005 +} + + +namespace eval quota { + +######################## +# COMMUNTY_QUOTA FUNCTIONS # +# FOR OACS 5.1 # +####################### + + +##### PARAMETERS +# Get default value of a par�meter +ad_proc -public get_parameter { + {-param ""} +} { + Returns the parameter default value with param name +} { + return [db_string sql "select default_value from apm_parameters where parameter_name = :param"] +} + +# Get default value of a par�meter +ad_proc -public get_parameter_id { + {-param ""} +} { + Returns the parameter id of the community instance +} { + return [db_string sql "select parameter_id from apm_parameters where parameter_name = :param"] +} + + +# Get the quota package_id of the community +ad_proc -public get_quota_package_id { + {-community_id ""} +} { + Returns the quota package_id of the community +} { + + set ctrl [db_0or1row get_quota_package_id {* sql*}] + if {$ctrl == 0} { + # Sin instancia --> a ver que hacemos, usar los valores por defecto??? + return 0 + } else { + return $pid + } + +} + +# Get the parameter instance for the community +ad_proc -public get_community_parameter { + {-community_id ""} + {-param ""} +} { + Returns the parameter instance for the community +} { + set pid [quota::get_quota_package_id -community_id $community_id] + if {$pid == 0} { + return [quota::get_parameter -param $param] + } else { + set param_id [quota::get_parameter_id -param $param] + db_0or1row get_community_parameter {* SQL *} + return $value + } +} + +# Update default value of a parameter +ad_proc -public update_parameter { + {-param ""} + {-value ""} +} { + Update the parameter default value +} { + db_dml update_parameter { *SQL* } +} + +# Update default value of a parameter +ad_proc -public update_community_parameter { + {-community_id ""} + {-param ""} + {-value ""} +} { + Update the parameter default value +} { + set pid [quota::get_quota_package_id -community_id $community_id] + set param_id [quota::get_parameter_id -param $param] + db_dml update_community_parameter { *SQL* } +} + + +############################## +# FUNCIONES + +# Devuelve lista de los folders_id que contiene un folder dado +ad_proc -public get_child_folders { + {-folder_id ""} +} { + Returns a child folder_id list of parent folder_id +} { + return [db_list get_child_folders get_child_folders] +} + + +# Devuelve lista de los folders_id que tiene una comunidad en su file-storage +# Se necesita pasar el root folder_id de la comunidad!!! +ad_proc -public get_filestorage_folders { + {-folder_id ""} +} { + Returns a folder_id list of community_filestorage +} { + # lista para lamacenar los directorios + + set l_folders [list $folder_id] + # Lista auxiliar para almacenar los directorios que nos quedan por tratar + set l_aux [quota::get_child_folders -folder_id $folder_id] + set l_folders [concat $l_folders $l_aux] + # Contador de vueltas + set cont [llength $l_aux] + + while { $cont > 0 } { + set c 0 + set l_aux2 [] + foreach obj $l_aux { + set l_aux1 [quota::get_child_folders -folder_id $obj] + set l_folders [concat $l_folders $l_aux1] + set l_aux2 [concat $l_aux2 $l_aux1] + set c [expr $c + [llength $l_aux1]] + } + if { $c > 0 } { + set l_aux $l_aux2 + } else { + set cont 0 + } + } + return $l_folders +} + +# Devuelve lista de los items_id que contiene el folder de tipo type_s +ad_proc -public get_folder_files { + {-folder_id ""} + {-type_s ""} +} { + Returns folders files +} { + return [db_list get_folder_files get_folder_files] +} + +# Devuelve lista de los items_id de tipo type_s que tiene una comunidad en su file-storage +# Se necesita pasar la lista de directorios de la comunidad!!! +ad_proc -public get_filestorage_files { + {-folders_list ""} +} { + Returns a files of the community folders +} { + set files_list [list] + foreach obj $folders_list { + set files_list [concat $files_list [quota::get_folder_files -folder_id $obj -type_s "file_storage_object"]] + } + return $files_list +} + +#Devuelve lista de revisiones de un item_id +ad_proc -public get_revision_files { + {-item_id ""} + } { + Returns revision files +} { + return [db_list get_revision_files get_revision_files] +} + + +# Devuelve lista de revision_id de la lista de item_id +ad_proc -public get_filestorage_revisions { + {-files_list ""} +} { + Returns a files of the community folders +} { + set revision_list [list] + foreach obj $files_list { + set revision_list [concat $revision_list [quota::get_revision_files -item_id $obj ]] + } + return $revision_list +} + +# Devuelve el espacio que ocupan los ficheros +ad_proc -public get_filesize { + {-revision_id ""} + {-units ""} +} { + Returns the filesize of revision_id +} { + set fsize 0 + if {[db_0or1row get_filesize {}] eq 0} { + return $fsize + } else { + switch -exact -- $units { + "b" {set fsize $size} + "kb" {set fsize [expr $size / 1024]} + "mb" {set fsize [expr $size / 1024 / 1024]} + default {set fsize [expr $size / 1024]} + } + return $fsize + } +} + +# Devuelve el espacio que ocupan los ficheros +ad_proc -public get_filestorage_used_quota { + {-revision_list ""} +} { + Returns de quota used by list revisions. P.e. Community files +} { + set quota 0 + foreach obj $revision_list { + set quota [expr $quota + [quota::get_filesize -revision_id $obj -units "kb"]] + } + return $quota +} + +# Devuelve lista de revision_id de la lista de item_id +ad_proc -public get_filestorage_user_revisions { + {-folder_list ""} + {-user_id ""} +} { + Returns a revisions files of the community folders +} { + set revision_list [list] + foreach obj $folder_list { + set revision_list [concat $revision_list [quota::get_folder_user_revisions -folder_id $obj -user_id $user_id]] + } + return $revision_list +} + +# devuelve la lista de revision_id de un usuario en el directorio +ad_proc -public get_folder_user_revisions { + {-folder_id ""} + {-user_id ""} +} { + Returns folders user_revisions +} { + return [db_list get_folder_user_revisions get_folder_user_revisions] +} + +# Devuelve las comunidades a las que pertenece un usuario +ad_proc -public get_user_communities { + {-user_id ""} +} { + Devuelve las comunidades a las que pertenece un usuario +} { + return [db_list get_user_communities {}] +} + +############################### +# GLOBAL +# Get user global files used +ad_proc -public get_used_quota_and_files { + {-user_id ""} +} { + Get user global quota and files used +} { + set quota 0 + set files 0 + set l_revisions [db_list get_user_qf {* SQL *}] + foreach r_size $l_revisions { + set files [expr $files + 1] + set quota [expr $quota + $r_size/1024] + } + set l_gobal_quota [list $quota $files] + return $l_gobal_quota +} + + +# PERSONAL +# Get user personal quota used +ad_proc -public get_used_pquota_and_pfiles { + {-user_id ""} +} { + Get user personal quota and files used +} { + set root_folder [dotlrn_fs::get_user_root_folder -user_id $user_id] + set l_folders [quota::get_filestorage_folders -folder_id $root_folder] + set l_files [quota::get_filestorage_files -folders_list $l_folders] + set l_revisions [quota::get_filestorage_revisions -files_list $l_files] + set quota [quota::get_filestorage_used_quota -revision_list $l_revisions] + return [list $quota [llength $l_revisions]] +} + +# COMUNITY +# Get community quota and files used +ad_proc -public get_used_cquota_and_cfiles { + {-community_id ""} +} { + Returns de quota used by a community with community_id +} { + if {$community_id eq ""} { + set community_id [dotlrn_community::get_community_id] + } + set root_fid [dotlrn_fs::get_community_root_folder -community_id $community_id] + set l_c_folders [quota::get_filestorage_folders -folder_id $root_fid] + set l_files [quota::get_filestorage_files -folders_list $l_c_folders] + set l_rev [quota::get_filestorage_revisions -files_list $l_files] + set quota [quota::get_filestorage_used_quota -revision_list $l_rev] + return [list $quota [llength $l_rev]] +} + +# USER _ COMMUNITY +# Get user-community quota and files used +ad_proc -public get_used_ucquota_and_ucfiles { + {-community_id ""} + {-user_id ""} +} { + Returns de quota used by a community with community_id +} { + if {$community_id eq ""} { + set community_id [dotlrn_community::get_community_id] + } + set root_fid [dotlrn_fs::get_community_root_folder -community_id $community_id] + set l_c_folders [quota::get_filestorage_folders -folder_id $root_fid] + set l_rev [quota::get_filestorage_user_revisions -folder_list $l_c_folders -user_id $user_id] + set quota [quota::get_filestorage_used_quota -revision_list $l_rev] + return [list $quota [llength $l_rev]] +} + +###################################### +# CHECKPOINT +ad_proc -public check_quota { + {-user_id ""} + {-community_id ""} + {-filesize 0} +} { + Allow upload files +} { + +# Init variables +set used_quota 0 +set used_files 0 +set used_pquota 0 +set used_pfiles 0 +set used_c_quota 0 +set used_c_files 0 + +# Get if user is root and if the control quota is enabled +set is_root [acs_user::site_wide_admin_p -user_id $user_id] +set is_quota_enabled [quota::get_parameter -param "QuotaEnabled"] +# If the user is root or the control quota is disabled --> We allow the upload without check +if {$is_root || !($is_quota_enabled)} { + return 1 +} else { + +# Check if the user has a personal quota and get the parameters + set has_quota [db_0or1row get_quota {* SQL *}] + if {$has_quota} { + set uc_enabled $usercomm_actv + set max_pquota $personal_quota + set max_pfiles $personal_files + set max_quota $global_quota + set max_files $global_files + } else { + set uc_enabled 1 + set max_pquota [quota::get_parameter -param "MaxQuotaByUserFolder"] + set max_pfiles [quota::get_parameter -param "MaxFilesByUserFolder"] + set max_quota [quota::get_parameter -param "MaxQuotaByUser"] + set max_files [quota::get_parameter -param "MaxFilesByUser"] + } + + if {$uc_enabled} { + set used_pquota_and_pfiles [quota::get_used_pquota_and_pfiles -user_id $user_id] + set used_pquota [expr [lindex $used_pquota_and_pfiles 0] + $filesize] + set used_pfiles [expr [lindex $used_pquota_and_pfiles 1] + 1] + } +# Check if we are in a community or in an user_folder + if {[string length $community_id] == 0} { + # CHECKING + + if {($used_pquota < $max_pquota) && ($used_pfiles < $max_pfiles)} { + return 1 + } else { + ns_log Notice "QUOTA >>> USER ($user_id) CAN'T UPLOAD TO ITS USER_FOLDER --> QUOTA ($used_pquota/$max_pquota) -- FILES ($used_pfiles/$max_pfiles)" + return 0 + } + + } else { + # COMMUNITY CASE + + if {$uc_enabled} { + set used_quota_and_files [quota::get_used_quota_and_files -user_id $user_id] + set used_quota [expr [lindex $used_quota_and_files 0] + $filesize - $used_pquota] + set used_files [expr [lindex $used_quota_and_files 1] + 1 - $used_pfiles] + } else { + } + + # Check if there are a quota instance for the community + set has_instances [quota::get_quota_package_id -community_id $community_id] + if {$has_instances == 0} { + set quota_c_enabled 1 + set max_c_quota [quota::get_parameter -param "MaxQuotaByCommunity"] + set max_c_files [quota::get_parameter -param "MaxFilesByCommunity"] + } else { + set quota_c_enabled [quota::get_community_parameter -param "QuotaEnabled" -community_id $community_id] + set max_c_quota [quota::get_community_parameter -param "MaxQuotaByCommunity" -community_id $community_id] + set max_c_files [quota::get_community_parameter -param "MaxFilesByCommunity" -community_id $community_id] + } + # Check if the community has the community_quota enabled + if {$quota_c_enabled} { + set used_cquota_and_cfiles [quota::get_used_cquota_and_cfiles -community_id $community_id] + set used_c_quota [expr [lindex $used_cquota_and_cfiles 0] + $filesize] + set used_c_files [expr [lindex $used_cquota_and_cfiles 1] + 1] + } { + } + + if {($used_quota <= $max_quota) && ($used_files <= $max_files) && \ + ($used_c_quota <= $max_c_quota) && ($used_c_files <= $max_c_files)} { + return 1 + } else { + ns_log Notice "QUOTA >>> USER ($user_id) CAN'T UPLOAD TO COMMUNITY ($community_id) --> QUOTA GLOBAL ($used_quota/$max_quota) -- FILES ($used_files/$max_files) -- COMMUNITY QUOTA ($used_c_quota/$max_c_quota) -- FILES ($used_c_files/$max_c_files)" + return 0 + } + } +} +# end no root and enabled_q +} +# end function +} + Index: openacs-4/packages/quota/tcl/quota-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/tcl/quota-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/tcl/quota-procs.xql 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,112 @@ + + + + postgresql7.1 + + + + select object_id as pid from acs_objects, apm_packages as apmp + where context_id = + (select package_id from dotlrn_communities_all + where community_id = :community_id) + and package_key = 'quota' + and object_id = apmp.package_id; + + + + + + select attr_value as value from apm_parameter_values + where parameter_id = :param_id and + package_id = :pid + + + + + + + + update apm_parameters set + default_value = :value + where parameter_name = :param + + + + + + + update apm_parameter_values + set attr_value = :value + where parameter_id = :param_id and + package_id = :pid + + + + + + select * from user_quota + where ref_user = :user_id + + + + + + + + select content_length from cr_revisions, acs_objects + where revision_id = object_id and + object_type = 'file_storage_object' and + content_length > 0 and + (creation_user = :user_id or modifying_user = :user_id); + + + + + + + + select folder_id + from fs_folders + where parent_id = :folder_id + + + + + + + select item_id + from cr_items + where parent_id = :folder_id and + content_type::text = :type_s::text + + + + + + select revision_id + from cr_revisions + where item_id = :item_id + + + + + + select content_length as size + from cr_revisions + where revision_id = :revision_id + + + + + + select community_id from dotlrn_member_rels_approved where user_id = :user_id + + + + + + select revision_id from cr_revisions where item_id in (select item_id from acs_objects, cr_items where object_type = 'content_item' and content_type = 'file_storage_object' and parent_id = :folder_id and object_id = item_id and (creation_user = :user_id or modifying_user = :user_id)); + + + + Index: openacs-4/packages/quota/www/quota.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/quota.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/quota.adp 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,44 @@ + + +@context;noquote@ +Quota + + +
+
+

  COMMUNITY QUOTA: @community_name@

+
+ + + + + + + + + + + + + + + + + + + + +
#quota.community##quota.total##quota.used##quota.rest#
#quota.quota_kb#@cq_total@@cq_used@@cq_rest@
#quota.quota_files#@cf_total@@cf_used@@cf_rest@
+ +
  +
+ Index: openacs-4/packages/quota/www/quota.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/quota.css,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/quota.css 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,74 @@ +/* CSS QUOTA PACKAGE - UVEG - fransola@uv.es */ + +td.param {font-weight:bold; padding-left:20px;vertical-align:top} +td.info {font-size:80%; padding-left:20px} + + + + + + + + + + + + + + + +/* OLD */ +a.t:hover {background:#ffcc00;padding-top:5px;padding-bottom:2px;} +a.button1 {font: 100% arial; border: solid 1px black; background-color: #99ccff; text-align: center; padding: 2px; padding-left: 8px; padding-right: 8px; color: black; text-decoration: none; white-space: nowrap;} + +a.button { font: 100% arial; border: solid 1px black; background-color: #e1e1e1; + text-align: center; padding: 1px; padding-left: 8px; padding-right: 8px; color: black; + text-decoration: none; white-space: nowrap; +} + + +a {color:#0048AF} +a:visited{color:#0048AF} +a.link1 {background:#FFFFE0;color:#383C93;font-weight:bold} +a.link1:visited{background:#FFFFE0;color:#383C93;font-weight:bold} +a.link1:hover {background:#FAC328;color:#383C93;font-weight:bold} +a.order {color:red;text-decoration: none} +img {border:0px} + + +form {font-size:11px;color:#003366} +input {font-size:11px;color:#003366} +select {font-size:11px;color:#003366} +textarea {font-size:11px;color:#003366} +pre {font: 95% arial} + +.list_c {padding:4px;border-right:1px solid #A0BDEB;padding-left:5px} +.list_h { background:#6186b0;border-bottom: 3px solid #A0BDEB; + padding-top: 3px; padding-bottom: 3px;color:white;text-align:left; } + +th.list_c { border-bottom: 3px solid #A0BDEB;} + +tr.list_c_sel { border-right:1px solid #A0BDEB;border-bottom: 1px solid #A0BDEB;background:#e0e0e0;} +tr.list-odd_c {padding:4px;border-right:1px solid #A0BDEB;background-color: #EAF2FF;} +tr.list-even_c {padding:4px;border-right:1px solid #A0BDEB;background-color: white;} + +td.list_c { border-bottom: 1px solid #A0BDEB;} +td.list_c_sel { border-right:1px solid #A0BDEB;border-bottom: 1px solid #A0BDEB;background:#e0e0e0;} +td.list_sel {padding:4px;border-right:1px solid #A0BDEB;padding-left:5px;background:#e0e0e0;} +td.list-button-bar {padding-top: 3px; font-size: 115%;} +td.orla {width:85px;height:85px;border: 1px solid #6186B0;font-size:9px;} +td.orla:hover {width:85px;height:85px;border: 1px solid #FAC328;font-size:9px;} + +div.volver {background:#6186b0;color:#ffffff;padding-top:5px;padding-bottom:2px;display:inline} +.volver {background:#6186b0;color:#ffffff;padding-top:5px;padding-bottom:2px;display:inline} + +.t_asig {background:#5C81B7;color:#ffffff;font-weight:bold;padding-top:5px;padding-bottom:2px;display:inline} +.t_nota {border:2px solid orange; color:#5C81B7;font-weight:bold;padding-top:5px;padding-bottom:2px;display:inline} + +a.t_volver {background:#5C81B7;color:#ffffff;font-weight:bold;padding-top:5px;padding-bottom:2px;display:inline} +a.t_volver:hover {background:#ffcc00;} +.t_nom {color:#003E76;font: 125% arial; font-weight:bold} + +.t_grade { color:#003E76;border:2px solid orange; margin:5px; padding-bottom:5px; padding-top: 5px; font: 115% arial;font-weight:bold} + + Index: openacs-4/packages/quota/www/quota.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/quota.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/quota.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,61 @@ + +ad_page_contract { +} -query { + {community_id:integer,optional ""} + +} -properties { + +} -validate { + +} + +set context [list [list "one-community-admin" [_ dotlrn.Admin]] [_ dotlrn.Manage_Members]] + +# prevent this page from being called when not in a community +# (i.e. the main dotlrn instance +if {[empty_string_p [dotlrn_community::get_community_id]]} { + ad_returnredirect "[dotlrn::get_url]" +} + +set community_name [db_string sql "select pretty_name from dotlrn_communities_all where community_id = $community_id"] + +# Community Max Quota +# Comprobar si la communidad tiene los parametros instanciados + set has_instances [quota::get_quota_package_id -community_id $community_id] +# Si no hay instancias cogemos par�metros globales + if {$has_instances == 0} { + set cq_total [quota::get_parameter -param "MaxQuotaByCommunity"] + set cf_total [quota::get_parameter -param "MaxFilesByCommunity"] + #set max_uc_quota [quota::get_parameter -param "MaxQuotaByUserComm"] + #set max_uc_files [quota::get_parameter -param "MaxFilesByUserComm"] +# Si hay instancias seleccionamos los par�metros de la comunidad + } else { + set cq_total [quota::get_community_parameter -param "MaxQuotaByCommunity" -community_id $community_id] + set cf_total [quota::get_community_parameter -param "MaxFilesByCommunity" -community_id $community_id] + #set max_uc_quota [quota::get_community_parameter -param "MaxQuotaByUserComm" -community_id] + #set max_uc_files [quota::get_community_parameter -param "MaxFilesByUserComm" -community_id] + } + + +# Community Used Quota +set used_cquota_and_cfiles [quota::get_used_cquota_and_cfiles -community_id $community_id] +set cq_used [lindex $used_cquota_and_cfiles 0] +set cf_used [lindex $used_cquota_and_cfiles 1] +set cb_used [lindex $used_cquota_and_cfiles 2] + + + +# Quota disponible +set cq_rest [expr $cq_total - $cq_used] +set cf_rest [expr $cf_total - $cf_used] + +if {$cq_rest < 0} { + set cq_rest 0 +} +if {$cf_rest < 0} { + set cf_rest 0 +} + + + +ad_return_template Index: openacs-4/packages/quota/www/user-quota.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/user-quota.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/user-quota.adp 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,147 @@ + + + +@context;noquote@ +Quota + + +
+
+ + +

  #quota.Detailed_user_quota#

+

    #quota.name#: @name@      #quota.user#: @username@

+ + + + +
    + +
  • #quota.no_quote_for_site_admin#

    + +
  • #quota.Global_quota#

    + + + + + + + + + + + + + + + + + + + +
     #quota.total##quota.used##quota.rest#
    #quota.quota_kb# --- @gq_used@ ---
    #quota.quota_files# --- @gf_used@ ---
    +
    +
  • #quota.Personal_folder_quota#

    + + + + + + + + + + + + + + + + + + + +
     #quota.total##quota.used##quota.rest#
    #quota.quota_kb# --- @pq_used@ ---
    #quota.quota_files#---@pf_used@---
    +
    +
+ +
+ +
    +
  • #quota.Global_quota#

    + + + + + + + + + + + + + + + + + + + +
     #quota.total##quota.used##quota.rest#
    #quota.quota_kb#@gq_total@@gq_used@@gq_rest@
    #quota.quota_files#@gf_total@@gf_used@@gf_rest@
    +
    +
  • #quota.Personal_folder_quota#

    + + + + + + + + + + + + + + + + + + + +
     #quota.total##quota.used##quota.rest#
    #quota.quota_kb#@pq_total@@pq_used@@pq_rest@
    #quota.quota_files#@pf_total@@pf_used@@pf_rest@
    +
    +
  • #quota.User_quota_by_community#

    + + + + + + + + + + + + + + +
    #quota.community##quota.used_quota##quota.quota_files#
    @usercomm.name@@usercomm.q_used@@usercomm.f_used@
    +
+
+
+
+ + +
\ No newline at end of file Index: openacs-4/packages/quota/www/user-quota.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/user-quota.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/user-quota.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,118 @@ +ad_page_contract { +} -query { + user_id:integer,notnull +} -properties { + usercomm:multirow +} -validate { + +} + +# prevent this page from being called when not in a community +# (i.e. the main dotlrn instance +#if {[empty_string_p [dotlrn_community::get_community_id]]} { +# ad_returnredirect "[dotlrn::get_url]" +#} + + +#template::multirow create usercomm name q_total f_total q_used f_used q_rest f_rest is_admin +template::multirow create usercomm name q_used f_used + + +set context [list [list "one-community-admin" [_ dotlrn.Admin]] [_ dotlrn.Manage_Members]] +set community_id [dotlrn_community::get_community_id] + +# Get user information +db_1row get_user_info "select username, first_names, last_name from acs_users_all where user_id = :user_id" + append name $last_name ", " $first_names + +set site_admin [acs_user::site_wide_admin_p -user_id $user_id] + + + +############################################### +# Obtenemos quota global y del directorio personal m�xima permitida para el usuario +set has_quota [db_0or1row get_user_quota "select * from user_quota where ref_user = :user_id"] + if {$has_quota} { + set gq_total $global_quota + set gf_total $global_files + set pq_total $personal_quota + set pf_total $personal_files + } else { + set gq_total [quota::get_parameter -param "MaxQuotaByUser"] + set gf_total [quota::get_parameter -param "MaxFilesByUser"] + set pq_total [quota::get_parameter -param "MaxQuotaByUserFolder"] + set pf_total [quota::get_parameter -param "MaxFilesByUserFolder"] + } + + + + +#################################### +# Obtenemos quota del directorio personal usada por del usuario +set used_pquota_and_pfiles [quota::get_used_pquota_and_pfiles -user_id $user_id] +set pq_used [lindex $used_pquota_and_pfiles 0] +set pf_used [lindex $used_pquota_and_pfiles 1] + +# Quota directorio personal disponible +set pq_rest [expr $pq_total - $pq_used] +set pf_rest [expr $pf_total - $pf_used] + +if {$pq_rest < 0} { + set pq_rest 0 +} +if {$pf_rest < 0} { + set pf_rest 0 +} + + +############################################## +# USER_COMMUNITY QUOTA +set gq_used 0 +set gf_used 0 +# Obtenim les comunitats de l'usuari + set l_comm [quota::get_user_communities -user_id $user_id] + + foreach com $l_comm { + # Comprobamos is es administrador o profe + set admin [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $com] + # Comprobar si la communidad tiene los parametros instanciados + #set has_instances [quota::get_quota_package_id -community_id $com] + # Si no hay instancias cogemos par�metros globales + #if {$has_instances == 0} { + # set ucq_total [quota::get_parameter -param "MaxQuotaByUserComm"] + # set ucf_total [quota::get_parameter -param "MaxFilesByUserComm"] + # Si hay instancias seleccionamos los par�metros de la comunidad + #} else { + # set ucq_total [quota::get_community_parameter -param "MaxQuotaByUserComm" -community_id $com] + # set ucf_total [quota::get_community_parameter -param "MaxFilesByUserComm" -community_id $com] + #} + set l_quota [quota::get_used_ucquota_and_ucfiles -community_id $com -user_id $user_id] + set names [dotlrn_community::get_community_name $com] + set qu [lindex $l_quota 0] + set fu [lindex $l_quota 1] + #set qr [expr $ucq_total - $qu] + #set fr [expr $ucf_total - $fu] + #template::multirow append usercomm $names $ucq_total $ucf_total $qu $fu $qr $fr $admin + template::multirow append usercomm $names $qu $fu + set gq_used [expr $gq_used + $qu] + set gf_used [expr $gf_used + $fu] + + } + + + # Obtenemos quota global usada por del usuario +# set used_quota_and_files [quota::get_used_quota_and_files -user_id $user_id] +# Aquesta funci� ja no serveix perque hem canviat la pol�tica de quotes. +# Quota disponible +set gq_rest [expr $gq_total - $gq_used] +set gf_rest [expr $gf_total - $gf_used] + +if {$gq_rest < 0} { + set gq_rest 0 +} +if {$gf_rest < 0} { + set gf_rest 0 +} + + +ad_return_template Index: openacs-4/packages/quota/www/admin/1.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/1.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/1.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,105 @@ +# Comprobamos si el usuario es ROOT +set is_root [acs_user::site_wide_admin_p -user_id [ad_conn user_id]] +# Comprobamos si el control de quota esta activado o no +set is_quota_enabled [[quota::get_parameter -param "QuotaEnabled"]] + +# Si el usuario es root o no hay quota habilitada --> dejamos hacer +if {$is_root || !$is_quota_enabled} { + return 1 # OK + +} else { +# en caso contrario vamos a ver que hacemos + +# Obtenemos la comunidad en la que estamos + set community_id [dotlrn_community::get_community_id] +# Si estamos en el user_folder + if {[string length $community_id] == 0} { + set community_id 0 + } else { + + # Si estamos en una comunidad +# Obtener el rol del usuario + if {[dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] == 1} { + set user_role "ADMIN" + } else { + set user_role "STUDENT" + } + } +# Comprobamos si el usuario tiene entrada en la user_quota +# y seleccionamos sus valores m�ximos permitidos + set has_quota [db_0or1row get_quota {* SQL *}] + if {$has_quota} { + set max_quota $global_quota + set max_files $global_files + set max_pquota $personal_quota + set max_pfiles $personal_files + set uc_enabled $usercomm_actv + } else { + set max_quota [quota::get_parameter -param "MaxQuotaByUser"] + set max_files [quota::get_parameter -param "MaxFilesByUser"] + set max_pquota [quota::get_parameter -param "MaxQuotaByUserFolder"] + set max_pfiles [quota::get_parameter -param "MaxFilesByUserFolder"] + set uc_enabled 1 + } + + # Obtenemos quota global usada por del usuario + set used_quota [quota::get_used_quota -user_id $user_id] + set used_files [quota::get_used_files -user_id $user_id] + +# CASO USER FOLDER + if {$community_id == 0} { + set used_pquota [quota::get_used_pquota -user_id $user_id] + set used_pfiles [quota::get_used_pfiles -user_id $user_id] + # COMPROVACI� + if {($used_quota < $max_quota) && ($used_files < $max_files) && \ + ($used_pquota < $max_pquota) && ($used_pfiles < $max_pfiles)} { + # OK + return 1 + } else { + # No permitimos la operaci�n --> Mensaje de error + return 0 + } + # fi comprovaci� + } else { + # CASO COMMUNITY +# Comprobar si la communidad tiene los parametros instanciados + set has_instances [quota::get_quota_package_id -community_id $community_id] +# Si no hay instancias cogemos par�metros globales + if {$has_instances == 0} { + set quota_c_enabled 1 + set max_c_quota [quota::get_parameter -param "MaxQuotaByCommunity"] + set max_c_files [quota::get_parameter -param "MaxFilesByCommunity"] + set max_uc_quota [quota::get_parameter -param "MaxQuotaByUserComm"] + set max_uc_files [quota::get_parameter -param "MaxFilesByUserComm"] +# Si hay instancias seleccionamos los par�metros de la comunidad + } else { + set quota_c_enabled [quota::get_community_parameter -param "QuotaEnabled" -community_id] + set max_c_quota [quota::get_community_parameter -param "MaxQuotaByCommunity" -community_id] + set max_c_files [quota::get_community_parameter -param "MaxFilesByCommunity" -community_id] + set max_uc_quota [quota::get_community_parameter -param "MaxQuotaByUserComm" -community_id] + set max_uc_files [quota::get_community_parameter -param "MaxFilesByUserComm" -community_id] + } + + if {$quota_c_enabled} { + set used_c_quota [quota::get_used_c_quota -community_id $community_id] + set used_c_files [quota::get_used_c_files -community_id $community_id] + } + + if {($user_role == "STUDENT") && ($uc_enabled == 1)} { + set used_uc_quota [quota::get_used_uc_quota -user_id $user_id -community_id $community_id] + set used_uc_files [quota::get_used_uc_files -user_id $user_id -community_id $community_id] + } + + # COMPROVACI� + if {($used_quota <= $max_quota) && ($used_files <= $max_files) && \ + ($used_c_quota <= $max_c_quota) && ($used_c_files <= $max_c_files) && \ + ($used_uc_quota <= $max_uc_quota) && ($used_uc_files <= $max_uc_files)} { + # OK + return 1 + } else { + # No permitimos la operaci�n --> Mensaje de error + return 0 + + } # fi comprovaci� + } # fin else + } #fin no root y enabled Index: openacs-4/packages/quota/www/admin/check.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/check.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/check.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,135 @@ +###################################### +# CHECKPOINT +ad_proc -public check_quota { + {-user_id ""} + {-community_id ""} + {-filesize 0} +} { + Allow upload files +} { + +# Inicializamos variables +set used_quota 0 +set used_files 0 +set used_pquota 0 +set used_pfiles 0 +set used_c_quota 0 +set used_c_files 0 +set used_uc_quota 0 +set used_uc_files 0 + +# Comprobamos si el usuario es ROOT +set is_root [acs_user::site_wide_admin_p -user_id $user_id] +# Comprobamos si el control de quota esta activado o no +set is_quota_enabled [quota::get_parameter -param "QuotaEnabled"] + +# Si el usuario es root o no hay quota habilitada --> dejamos hacer +if {$is_root || !($is_quota_enabled)} { + # OK -- upload allowed + return 1 +} else { +# Obtenemos la comunidad en la que estamos + #set community_id [dotlrn_community::get_community_id] +# Si estamos en el user_folder + if {[string length $community_id] == 0} { + set community_id 0 + } else { + + # Si estamos en una comunidad +# Obtener el rol del usuario + if {[dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] == 1} { + set user_role "ADMIN" + } else { + set user_role "STUDENT" + } + } +# Comprobamos si el usuario tiene entrada en la user_quota +# y seleccionamos sus valores m�ximos permitidos + # set ref_user $user_id + set has_quota [db_0or1row get_quota {* SQL *}] + if {$has_quota} { + set max_quota $global_quota + set max_files $global_files + set max_pquota $personal_quota + set max_pfiles $personal_files + set uc_enabled $usercomm_actv + } else { + set max_quota [quota::get_parameter -param "MaxQuotaByUser"] + set max_files [quota::get_parameter -param "MaxFilesByUser"] + set max_pquota [quota::get_parameter -param "MaxQuotaByUserFolder"] + set max_pfiles [quota::get_parameter -param "MaxFilesByUserFolder"] + set uc_enabled 1 + } + + # Obtenemos quota global usada por del usuario + set used_quota_and_files [quota::get_used_quota_and_files -user_id $user_id] + set used_quota [expr [lindex $used_quota_and_files 0] + $filesize] + set used_files [expr [lindex $used_quota_and_files 1] + 1] + +# CASO USER FOLDER + if {$community_id == 0} { + set used_pquota_and_pfiles [quota::get_used_pquota_and_pfiles -user_id $user_id] + set used_pquota [expr [lindex $used_pquota_and_pfiles 0] + $filesize] + set used_pfiles [expr [lindex $used_pquota_and_pfiles 1] + 1] + + # COMPROVACI� + + + if {($used_quota < $max_quota) && ($used_files < $max_files) && \ + ($used_pquota < $max_pquota) && ($used_pfiles < $max_pfiles)} { + # OK + return 1 + } else { + # No permitimos la operaci�n --> Mensaje de error + return 0 + } + # fi comprovaci� + } else { + # CASO COMMUNITY +# Comprobar si la communidad tiene los parametros instanciados + set has_instances [quota::get_quota_package_id -community_id $community_id] +# Si no hay instancias cogemos par�metros globales + if {$has_instances == 0} { + set quota_c_enabled 1 + set max_c_quota [quota::get_parameter -param "MaxQuotaByCommunity"] + set max_c_files [quota::get_parameter -param "MaxFilesByCommunity"] + set max_uc_quota [quota::get_parameter -param "MaxQuotaByUserComm"] + set max_uc_files [quota::get_parameter -param "MaxFilesByUserComm"] +# Si hay instancias seleccionamos los par�metros de la comunidad + } else { + set quota_c_enabled [quota::get_community_parameter -param "QuotaEnabled" -community_id $community_id] + set max_c_quota [quota::get_community_parameter -param "MaxQuotaByCommunity" -community_id $community_id] + set max_c_files [quota::get_community_parameter -param "MaxFilesByCommunity" -community_id $community_id] + set max_uc_quota [quota::get_community_parameter -param "MaxQuotaByUserComm" -community_id $community_id] + set max_uc_files [quota::get_community_parameter -param "MaxFilesByUserComm" -community_id $community_id] + } + + if {$quota_c_enabled} { + set used_cquota_and_cfiles [quota::get_used_cquota_and_cfiles -community_id $community_id] + set used_c_quota [expr [lindex $used_cquota_and_cfiles 0] + $filesize] + set used_c_files [expr [lindex $used_cquota_and_cfiles 1] + 1] + } + + if {($user_role == "STUDENT") && ($uc_enabled == 1)} { + set used_ucquota_and_ucfiles [quota::get_used_ucquota_and_ucfiles -community_id $community_id -user_id $user_id] + set used_uc_quota [expr [lindex $used_ucquota_and_ucfiles 0] + $filesize] + set used_uc_files [expr [lindex $used_ucquota_and_ucfiles 1] + 1] + } + + # COMPROVACI� + if {($used_quota <= $max_quota) && ($used_files <= $max_files) && \ + ($used_c_quota <= $max_c_quota) && ($used_c_files <= $max_c_files) && \ + ($used_uc_quota <= $max_uc_quota) && ($used_uc_files <= $max_uc_files)} { + # OK + return 1 + } else { + # No permitimos la operaci�n --> Mensaje de error + return 0 + } + # fi comprovaci� + } + # fin else + } + #fin no root y enabled +} +# fin check Index: openacs-4/packages/quota/www/admin/manage_community_quota.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_community_quota.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_community_quota.adp 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,86 @@ + + + + + + +

#quota-portlet.quota_admin#

+ + + + + + +

@pretty_name@

+

#quota.back#

+
Community ID: @community_id@      +Community Key: @community_key@ +
+ +

This community hasn't instancied the package quota. To set special values for this community it's needed to add the applet "QUOTA" +
+Instance package quota for this community now +

+ + +
+ + + + + + + + + + + + + + + + + + +
+ +

#quota.quota_on# #quota.quota_set_off#

+
+

#quota.quota_off# #quota.quota_set_on#

+
+

#quota.parameters#

+
MaxQuotaByCommunity + +
+ #quota.MaxQuotaByCommunity_help# +
MaxFilesByCommunity + +
+ #quota.MaxFilesByCommunity_help#
+ + + +
+
Index: openacs-4/packages/quota/www/admin/manage_community_quota.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_community_quota.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_community_quota.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,65 @@ +# Copyright (C) 2006 University of Valencia +# Author: Paco Soler +# This file is part of dotLRN. + +ad_page_contract { +} -query { + {mode:optional ""} + {cid:optional ""} + {new_MaxFilesByCommunity:optional ""} + {new_MaxQuotaByCommunity:optional ""} + {new_MaxFilesByUserComm:optional ""} + {new_MaxQuotaByUserComm:optional ""} +} -properties { +} + + +# Control site_wide_admin +if {![acs_user::site_wide_admin_p -user_id [ad_conn user_id]]} { + ad_returnredirect "[dotlrn::get_url]" +} + +# Get community_id +#set cid [dotlrn_community::get_community_id] + +# Get community datails +db_1row get_community_info {* SQL *} +set community_url [dotlrn_community::get_community_url $cid] +set referer [ns_conn url] +append referer "?cid=" $cid + +# Check if the community has instanced the quota package +set has_instances [quota::get_quota_package_id -community_id $cid] +if {$has_instances > 0} { + +# Control Cuota Activation +if {$mode eq "update_cqc"} { + set QuotaEnabled [quota::get_community_parameter -community_id $cid -param "QuotaEnabled"] + if {$QuotaEnabled} { + quota::update_community_parameter -param "QuotaEnabled" -value 0 -community_id $cid + } else { + quota::update_community_parameter -param "QuotaEnabled" -value 1 -community_id $cid + } +} + +# Update Default Parameters Values +if {$mode eq "update_community_parameters"} { + quota::update_community_parameter -param "MaxFilesByCommunity" \ + -value $new_MaxFilesByCommunity -community_id $cid + quota::update_community_parameter -param "MaxQuotaByCommunity" \ + -value $new_MaxQuotaByCommunity -community_id $cid + quota::update_community_parameter -param "MaxFilesByUserComm" \ + -value $new_MaxFilesByUserComm -community_id $cid + quota::update_community_parameter -param "MaxQuotaByUserComm" \ + -value $new_MaxQuotaByUserComm -community_id $cid +} + + +# Get parameter instances values +set MaxFilesByCommunity [quota::get_community_parameter -param "MaxFilesByCommunity" -community_id $cid] +set MaxQuotaByCommunity [quota::get_community_parameter -param "MaxQuotaByCommunity" -community_id $cid] +set MaxFilesByUserComm [quota::get_community_parameter -param "MaxFilesByUserComm" -community_id $cid] +set MaxQuotaByUserComm [quota::get_community_parameter -param "MaxQuotaByUserComm" -community_id $cid] +set QuotaEnabled [quota::get_community_parameter -param "QuotaEnabled" -community_id $cid] + +} Index: openacs-4/packages/quota/www/admin/manage_community_quota.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_community_quota.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_community_quota.xql 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + select community_id, pretty_name, community_key + from dotlrn_communities_all + where community_id = :cid + + + + + Index: openacs-4/packages/quota/www/admin/manage_site_quota.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_site_quota.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_site_quota.adp 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,136 @@ + +<% + # + # Copyright (C) 2004 University of Valencia + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # +%> + + +

#quota-portlet.quota_admin#

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +

#quota.quota_on# #quota.quota_set_off#

+
+

#quota.quota_off# #quota.quota_set_on#

+
+

#quota.parameters#

+
MaxQuotaByCommunity + +
+ #quota.MaxQuotaByCommunity_help# +
MaxQuotaByUser + +
+ #quota.MaxQuotaByUser_help# +
MaxQuotaByUserFolder + +
+ #quota.MaxQuotaByUserFolder_help# +
MaxFilesByCommunity + +
+ #quota.MaxFilesByCommunity_help# +
MaxFilesByUser + +
+ #quota.MaxFilesByUser_help# +
MaxFilesByUserFolder + +
+ #quota.MaxFilesByUserFolder_help#
+ + +
+ + + + + + + + +
+

#quota.quota_by_community#

+
#quota.name# + +      + + +
+ + + + + + + + + + +
+

#quota.quota_by_user#

+
#quota.name# + +      + + + +
#quota.username# + +      + + + +
Index: openacs-4/packages/quota/www/admin/manage_site_quota.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_site_quota.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_site_quota.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,72 @@ + # + # Copyright (C) 2006 University of Valencia + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # + +ad_page_contract { +} -query { + {mode:optional ""} + {new_MaxFilesByCommunity:optional ""} + {new_MaxQuotaByCommunity:optional ""} + {new_MaxFilesByUser:optional ""} + {new_MaxQuotaByUser:optional ""} + {new_MaxFilesByUserComm:optional ""} + {new_MaxQuotaByUserComm:optional ""} + {new_MaxFilesByUserFolder:optional ""} + {new_MaxQuotaByUserFolder:optional ""} + +} -properties { +} + +# Control site_wide_admin +if {![acs_user::site_wide_admin_p -user_id [ad_conn user_id]]} { + ad_returnredirect "[dotlrn::get_url]" +} + +# Control Cuota Activation +if {$mode eq "update_qc"} { + set QuotaEnabled [quota::get_parameter -param "QuotaEnabled"] + if {$QuotaEnabled} { + quota::update_parameter -param "QuotaEnabled" -value 0 + } else { + quota::update_parameter -param "QuotaEnabled" -value 1 + } +} + +# Update Default Parameters Values +if {$mode eq "update_parameters"} { + quota::update_parameter -param "MaxFilesByCommunity" -value $new_MaxFilesByCommunity + quota::update_parameter -param "MaxQuotaByCommunity" -value $new_MaxQuotaByCommunity + quota::update_parameter -param "MaxFilesByUser" -value $new_MaxFilesByUser + quota::update_parameter -param "MaxQuotaByUser" -value $new_MaxQuotaByUser + quota::update_parameter -param "MaxFilesByUserComm" -value $new_MaxFilesByUserComm + quota::update_parameter -param "MaxQuotaByUserComm" -value $new_MaxQuotaByUserComm + quota::update_parameter -param "MaxFilesByUserFolder" -value $new_MaxFilesByUserFolder + quota::update_parameter -param "MaxQuotaByUserFolder" -value $new_MaxQuotaByUserFolder +} + + + +# Obtenemos valores de los par�metros +set MaxFilesByCommunity [quota::get_parameter -param "MaxFilesByCommunity"] +set MaxQuotaByCommunity [quota::get_parameter -param "MaxQuotaByCommunity"] +set MaxFilesByUser [quota::get_parameter -param "MaxFilesByUser"] +set MaxQuotaByUser [quota::get_parameter -param "MaxQuotaByUser"] +set MaxFilesByUserComm [quota::get_parameter -param "MaxFilesByUserComm"] +set MaxQuotaByUserComm [quota::get_parameter -param "MaxQuotaByUserComm"] +set MaxFilesByUserFolder [quota::get_parameter -param "MaxFilesByUserFolder"] +set MaxQuotaByUserFolder [quota::get_parameter -param "MaxQuotaByUserFolder"] +set QuotaEnabled [quota::get_parameter -param "QuotaEnabled"] + + Index: openacs-4/packages/quota/www/admin/manage_user_quota.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_user_quota.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_user_quota.adp 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,178 @@ + + + + + + +

#quota-portlet.quota_admin#

+ + + + + + + + + + + +
    +
  • #quota.no_quote_for_site_admin#

    +
+
+ + + + + + + + + + + + +

@last_name@, @first_names@

+

#quota.back#

+
  • User ID: @user_id@     
+
  • Username: @username@
+
+
    +
  • #quota.Global_quota#

    + + + + + + + + + + + + + + + + + + + +
     #quota.total##quota.used##quota.rest#
    #quota.quota_kb#@gq_total@@gq_used@@gq_rest@
    #quota.quota_files#@gf_total@@gf_used@@gf_rest@
    +
+
+
    +
  • #quota.Personal_folder_quota#

    + + + + + + + + + + + + + + + + + + + +
     #quota.total##quota.used##quota.rest#
    #quota.quota_kb#@pq_total@@pq_used@@pq_rest@
    #quota.quota_files#@pf_total@@pf_used@@pf_rest@
    +
+
+
    +
  • #quota.User_quota_by_community#

    + + + + + + + + + + + + + + +
    #quota.community##quota.used_quota##quota.quota_files#
    @usercomm.name@@usercomm.q_used@@usercomm.f_used@
    +
+ +
+
#quota.user_havent_quota# +#quota.create_user_quota# +
+ + +#quota.user_have_quota# +#quota.delete_user_quota# + + + + + +

#quota.quota_on# #quota.quota_set_off#

+
+

#quota.quota_off# #quota.quota_set_on#

+
+ + +

#quota.parameters#

+ +
+ +MaxQuotaByUser + +
+ #quota.MaxQuotaByUser_help# + + +MaxQuotaByUserFolder + +
+ #quota.MaxQuotaByUserFolder_help# + + +MaxFilesByUser + +
+ #quota.MaxFilesByUser_help# + + +MaxFilesByUserFolder + +
+ #quota.MaxFilesByUserFolder_help#
+ + + +
  + + +
+ + +
Index: openacs-4/packages/quota/www/admin/manage_user_quota.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_user_quota.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_user_quota.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,170 @@ +# Copyright (C) 2006 University of Valencia +# Author: Paco Soler +# This file is part of dotLRN. + +ad_page_contract { +} -query { + {mode:optional ""} + {uid:optional ""} + {new_global_quota:optional ""} + {new_global_files:optional ""} + {new_personal_quota:optional ""} + {new_personal_files:optional ""} + {new_usercomm_actv:optional ""} +} -properties { +} + + +# Control site_wide_admin +if {![acs_user::site_wide_admin_p -user_id [ad_conn user_id]]} { + ad_returnredirect "[dotlrn::get_url]" +} + +# Get community_id +set cid [dotlrn_community::get_community_id] + +# Get user datails +db_1row get_user_info {* SQL *} + + + +############################################################ +template::multirow create usercomm name q_used f_used +set user_id $uid +set community_id $cid +set site_admin [acs_user::site_wide_admin_p -user_id $user_id] + +############################################### +# Obtenemos quota global y del directorio personal m�xima permitida para el usuario +set has_quota [db_0or1row get_user_quota "select * from user_quota where ref_user = :user_id"] + if {$has_quota} { + set gq_total $global_quota + set gf_total $global_files + set pq_total $personal_quota + set pf_total $personal_files + } else { + set gq_total [quota::get_parameter -param "MaxQuotaByUser"] + set gf_total [quota::get_parameter -param "MaxFilesByUser"] + set pq_total [quota::get_parameter -param "MaxQuotaByUserFolder"] + set pf_total [quota::get_parameter -param "MaxFilesByUserFolder"] + } + + + + +#################################### +# Obtenemos quota del directorio personal usada por del usuario +set used_pquota_and_pfiles [quota::get_used_pquota_and_pfiles -user_id $user_id] +set pq_used [lindex $used_pquota_and_pfiles 0] +set pf_used [lindex $used_pquota_and_pfiles 1] + +# Quota directorio personal disponible +set pq_rest [expr $pq_total - $pq_used] +set pf_rest [expr $pf_total - $pf_used] + +if {$pq_rest < 0} { + set pq_rest 0 +} +if {$pf_rest < 0} { + set pf_rest 0 +} + + +############################################## +# USER_COMMUNITY QUOTA +set gq_used 0 +set gf_used 0 +# Obtenim les comunitats de l'usuari + set l_comm [quota::get_user_communities -user_id $user_id] + + foreach com $l_comm { + # Comprobamos is es administrador o profe + set admin [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $com] + # Comprobar si la communidad tiene los parametros instanciados + #set has_instances [quota::get_quota_package_id -community_id $com] + # Si no hay instancias cogemos par�metros globales + #if {$has_instances == 0} { + # set ucq_total [quota::get_parameter -param "MaxQuotaByUserComm"] + # set ucf_total [quota::get_parameter -param "MaxFilesByUserComm"] + # Si hay instancias seleccionamos los par�metros de la comunidad + #} else { + # set ucq_total [quota::get_community_parameter -param "MaxQuotaByUserComm" -community_id $com] + # set ucf_total [quota::get_community_parameter -param "MaxFilesByUserComm" -community_id $com] + #} + set l_quota [quota::get_used_ucquota_and_ucfiles -community_id $com -user_id $user_id] + set names [dotlrn_community::get_community_name $com] + set qu [lindex $l_quota 0] + set fu [lindex $l_quota 1] + #set qr [expr $ucq_total - $qu] + #set fr [expr $ucf_total - $fu] + #template::multirow append usercomm $names $ucq_total $ucf_total $qu $fu $qr $fr $admin + template::multirow append usercomm $names $qu $fu + set gq_used [expr $gq_used + $qu] + set gf_used [expr $gf_used + $fu] + + } + + +# Obtenemos quota global usada por del usuario +# set used_quota_and_files [quota::get_used_quota_and_files -user_id $user_id] +# Aquesta funci� ja no serveix perque hem canviat la pol�tica de quotes. +# Quota disponible +set gq_rest [expr $gq_total - $gq_used] +set gf_rest [expr $gf_total - $gf_used] + +if {$gq_rest < 0} { + set gq_rest 0 +} +if {$gf_rest < 0} { + set gf_rest 0 +} + +############################################################ +############################################################ +############################################################ + + +# Get parameter instances values if exists +set ctrl [db_0or1row get_user_quota {* SQL *}] + + if {$ctrl == 0} { + set has_quota 0 + if {$mode == "create_quota"} { + # Get default parameters + set new_global_files [quota::get_parameter -param "MaxFilesByUser"] + set new_global_quota [quota::get_parameter -param "MaxQuotaByUser"] + set new_personal_files [quota::get_parameter -param "MaxFilesByUserFolder"] + set new_personal_quota [quota::get_parameter -param "MaxQuotaByUserFolder"] + db_dml insert_user_quota {* SQL *} + set has_quota 1 + ad_returnredirect "manage_user_quota?uid=$uid" + } + } else { + set has_quota 1 + + if {$mode == "delete_quota"} { + db_dml delete_user_quota {* SQL *} + set has_quota 0 + ad_returnredirect "manage_user_quota?uid=$uid" + } + # Control CuotaUserComm Activation + if {$mode == "enable_usercomm_quota"} { + if {$usercomm_actv} { + set value 0 + db_dml update_user_quota_actv {* SQL *} + } else { + set value 1 + db_dml update_user_quota_actv {* SQL *} + } + } + + # Update parameter instance values + if {$mode == "update_user_quota"} { + db_dml update_user_quota {* SQL *} + } + + # Get parameter instances values + db_1row get_user_quota {* SQL *} +} + + Index: openacs-4/packages/quota/www/admin/manage_user_quota.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/manage_user_quota.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/manage_user_quota.xql 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,57 @@ + + + + postgresql7.1 + + + + select user_id, first_names, last_name, username + from acs_users_all + where user_id = :uid + + + + + + select * from user_quota + where ref_user = :uid + + + + + + update user_quota + set usercomm_actv = :value + where quota_id = :quota_id + + + + + + update user_quota + set global_quota = :new_global_quota, + global_files = :new_global_files, + personal_quota = :new_personal_quota, + personal_files = :new_personal_files + where quota_id = :quota_id + + + + + + insert into user_quota (ref_user, global_quota, global_files, + personal_quota, personal_files, usercomm_actv) + values (:uid, :new_global_quota, :new_global_files, + :new_personal_quota, :new_personal_files, true) + + + + + + delete from user_quota + where quota_id = :quota_id and + ref_user = :uid + + + + Index: openacs-4/packages/quota/www/admin/select_community.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/select_community.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/select_community.adp 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,34 @@ + + + + + + +

#quota-portlet.quota_admin#

+ + + + + + + + + + + + + + + + + +

#quota.select_community# +

#quota.back#

+
IDPRETTY NAMEKEY
@comm.community_id@@comm.pretty_name@@comm.community_key@
Index: openacs-4/packages/quota/www/admin/select_community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/select_community.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/select_community.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,21 @@ +# Author: Paco Soler (fransola@uv.es) + +ad_page_contract { +} -query { + {mode:optional ""} + {comm_name:optional ""} +} -properties { +} + +# Control site_wide_admin +if {![acs_user::site_wide_admin_p -user_id [ad_conn user_id]]} { + ad_returnredirect "[dotlrn::get_url]" +} + +# If username & name are empty redirect to manage_site_quota +if { [string length $comm_name] == 0 } { + ad_returnredirect "manage_site_quota" +} + + +db_multirow comm select_communities {* SQL *} Index: openacs-4/packages/quota/www/admin/select_community.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/select_community.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/select_community.xql 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,16 @@ + + + + postgresql7.1 + + + + select community_id, pretty_name, community_key + from dotlrn_communities_all + where pretty_name like '%$comm_name%' + order by pretty_name asc + + + + + Index: openacs-4/packages/quota/www/admin/select_user.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/select_user.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/select_user.adp 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,37 @@ + + + + + + +

#quota-portlet.quota_admin#

+ + + + + + + + + + + + + + + + + + + + +

#quota.select_user# +

#quota.back#

+
USER_IDNAMEUSERNAME
@user.user_id@@user.last_name@, @user.first_names@@user.username@
@user:rowcount@ #quota.user#s
Index: openacs-4/packages/quota/www/admin/select_user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/select_user.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/select_user.tcl 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,26 @@ +# Author: Paco Soler (fransola@uv.es) + +ad_page_contract { +} -query { + {mode:optional ""} + {name:optional ""} + {username:optional ""} +} -properties { +} + +# Control site_wide_admin +if {![acs_user::site_wide_admin_p -user_id [ad_conn user_id]]} { + ad_returnredirect "[dotlrn::get_url]" +} + +# If username & name are empty redirect to manage_site_quota +if { ([string length $name] == 0) && ([string length $username] == 0) } { + ad_returnredirect "manage_site_quota" +} + +# Obtenemos los usuarios +if {$mode eq "username"} { + db_multirow user select_usernames {* SQL *} +} else { + db_multirow user select_users {* SQL *} +} Index: openacs-4/packages/quota/www/admin/select_user.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/admin/select_user.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/admin/select_user.xql 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,25 @@ + + + + postgresql7.1 + + + + select user_id, first_names, last_name, username + from acs_users_all + where last_name like '$name%' + order by last_name asc + + + + + + + select user_id, first_names, last_name, username + from acs_users_all + where username like '$username%' + order by last_name asc + + + + Index: openacs-4/packages/quota/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/quota/www/doc/index.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/quota/www/doc/index.html 21 Jun 2006 16:46:18 -0000 1.1 @@ -0,0 +1,38 @@ + +Important: +---------- + +At this stage, quota only works with web uploads. Not webdav. + +Besides to install the package quota, to make work it you must modify the file file-storage/www/file-add.tcl +of a form similar to this: + + +CHANGE THIS +max_size -requires {upload_file} { + set n_bytes [file size ${upload_file.tmpfile}] + set max_bytes [ad_parameter "MaximumFileSize"] + if { $n_bytes > $max_bytes } { + ad_complain "Your file is larger than the maximum file size allowed on this system ([util_commify_number $max_bytes] bytes)" + } +} + +FOR +max_size -requires {upload_file} { + set n_bytes [file size ${upload_file.tmpfile}] + set max_bytes [ad_parameter "MaximumFileSize"] + if { $n_bytes > $max_bytes } { + ad_complain "Your file is larger than the maximum file size allowed on this system ([util_commify_number $max_bytes] bytes)" + } + + #*************************************** + set u_id [ad_conn user_id] + set c_id [dotlrn_community::get_community_id] + set kb_size [expr $n_bytes / 1024] + set quota_ctrl [quota::check_quota -community_id $c_id -user_id $u_id -filesize $kb_size] + if {!$quota_ctrl} { + ad_complain "The size of the file execedes the quota that you have assigned or the quota of the group/community" + } + #*************************************** +} +