version 1.96, 2006/11/22 20:16:16
|
version 1.99, 2007/01/10 19:51:35
|
Line 41 use Apache::lonlocal;
|
Line 41 use Apache::lonlocal;
|
use Apache::lonmsg; |
use Apache::lonmsg; |
use Apache::lonmenu; |
use Apache::lonmenu; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use LONCAPA; |
|
|
sub handler { |
sub handler { |
|
|
Line 157 sub getEffectiveUrl {
|
Line 158 sub getEffectiveUrl {
|
# |
# |
$fn=~s/^http\:\/\/[^\/]+\///; |
$fn=~s/^http\:\/\/[^\/]+\///; |
$fn=~s/^\///; |
$fn=~s/^\///; |
$fn=~s/\~(\w+)/\/home\/$1\/public_html/; |
$fn=~s{~($LONCAPA::username_re)}{/home/$1/public_html}; |
|
|
# Remove trailing / strings (?) |
# Remove trailing / strings (?) |
|
|
Line 170 sub getEffectiveUrl {
|
Line 171 sub getEffectiveUrl {
|
#internal authentication, needs fixup. |
#internal authentication, needs fixup. |
$fn = $r->uri(); # non users do not get the full path request |
$fn = $r->uri(); # non users do not get the full path request |
# through SCRIPT_FILENAME |
# through SCRIPT_FILENAME |
$fn=~s|^/~(\w+)|/home/$1/public_html|; |
$fn=~s{^/~($LONCAPA::username_re)}{/home/$1/public_html}; |
} |
} |
} |
} |
$fn=~s/\/+/\//g; |
$fn=~s/\/+/\//g; |
Line 311 parent.lastknownpriv='/~$uname$thisdisfn
|
Line 312 parent.lastknownpriv='/~$uname$thisdisfn
|
function changename(theform,activity) { |
function changename(theform,activity) { |
var oldname=theform.dispfilename.value; |
var oldname=theform.dispfilename.value; |
var newname=prompt('New Name',oldname); |
var newname=prompt('New Name',oldname); |
if (newname == "" || !newname) { |
if (newname == "" || !newname || newname == oldname) { |
return |
return |
} |
} |
document.moveresource.newfilename.value = newname |
document.moveresource.newfilename.value = newname |
Line 514 sub putdirectory {
|
Line 515 sub putdirectory {
|
%Apache::lonpublisher::metadatafields=(); |
%Apache::lonpublisher::metadatafields=(); |
%Apache::lonpublisher::metadatakeys=(); |
%Apache::lonpublisher::metadatakeys=(); |
my $construct=$here; |
my $construct=$here; |
$construct=~s:^/priv/(\w+)$:/home/$1/public_html:; |
$construct=~s{^/priv/($LONCAPA::username_re)$}{/home/$1/public_html}; |
my $dirpath = $here; |
my $dirpath = $here; |
$dirpath=~s:^/priv/:/~:; |
$dirpath=~s{^/priv/}{/~}; |
&Apache::lonpublisher::metaeval(&Apache::lonnet::getfile( |
&Apache::lonpublisher::metaeval(&Apache::lonnet::getfile( |
$construct.'/'.$dirname.'/default.meta' |
$construct.'/'.$dirname.'/default.meta' |
)); |
)); |
Line 715 sub create_pubselect {
|
Line 716 sub create_pubselect {
|
<input type="hidden" name="filename" value="/~'. |
<input type="hidden" name="filename" value="/~'. |
&HTML::Entities::encode($uname.$thisdisfn.'/'.$filename,'<>&"').'" /> |
&HTML::Entities::encode($uname.$thisdisfn.'/'.$filename,'<>&"').'" /> |
<input type="hidden" name="dispfilename" value="'. |
<input type="hidden" name="dispfilename" value="'. |
&HTML::Entities::encode($filename).'"</form>'; |
&HTML::Entities::encode($filename).'" /></form>'; |
$$numres ++; |
$$numres ++; |
} |
} |
|
|