From: Atif G. <ma...@us...> - 2002-05-31 04:07:25
|
Update of /cvsroot/ispman/ispman-utils/lib/ISPMan/ApacheMan In directory usw-pr-cvs1:/tmp/cvs-serv24277/lib/ISPMan/ApacheMan Modified Files: Aliases.pm Redirects.pm Log Message: Index: Aliases.pm =================================================================== RCS file: /cvsroot/ispman/ispman-utils/lib/ISPMan/ApacheMan/Aliases.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Aliases.pm 30 May 2002 18:55:21 -0000 1.1 --- Aliases.pm 31 May 2002 04:07:20 -0000 1.2 *************** *** 98,122 **** sub updateAlias { - # update Alias is - # delete Old Entry - # create new entry - my $self=shift; my $r=shift; ! if ($r->param("modifyAlias") eq $r->param("ispmanVhostAlias")){ ! $self->update_alias( ! $r->param("ispmanDomain"), ! $r->param("ispmanVhostName"), ! $r->param("ispmanVhostAlias") ! ); ! } else { ! #hmm, lets delete the old entry and create a new one. ! #the entry DN is dependant on the location ! my $oldDN=$self->getAliasDN($r->param("ispmanDomain"), ! $r->param("ispmanVhostName"), $r->param("modifyAlias")); ! if ($self->deleteEntry($oldDN)){ ! return $self->addAlias($r); ! } ! } $r->param("section", "aliases"); $self->editVhost($r); --- 98,111 ---- sub updateAlias { my $self=shift; my $r=shift; ! ! $self->update_alias( ! $r->param("ispmanDomain"), ! $r->param("ispmanVhostName"), ! $r->param("ispmanVhostAlias"), ! $r->param("modifyAlias") ! ); ! $r->param("section", "aliases"); $self->editVhost($r); *************** *** 124,129 **** sub update_alias { my $self=shift; ! my ($domain, $vhost, $alias)=@_; my $dn=$self->getAliasDN($domain, $vhost, $alias); --- 113,126 ---- sub update_alias { + # update Alias is + # delete Old Entry + # create new entry + my $self=shift; ! my ($domain, $vhost, $alias, $oldalias)=@_; ! if ($oldalias && $oldalias ne $alias) { ! $self->delete_alias($domain, $vhost, $oldalias); ! return $self->add_alias($domain, $vhost, $alias); ! } my $dn=$self->getAliasDN($domain, $vhost, $alias); Index: Redirects.pm =================================================================== RCS file: /cvsroot/ispman/ispman-utils/lib/ISPMan/ApacheMan/Redirects.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Redirects.pm 30 May 2002 18:55:21 -0000 1.1 --- Redirects.pm 31 May 2002 04:07:20 -0000 1.2 *************** *** 98,132 **** sub updateRedirect { - # update redirection is - # delete Old Entry - # create new entry my $self=shift; my $r=shift; ! if ($r->param("modifyURL") eq $r->param("ispmanVhostRedirectURL")){ ! #phew, user didnt change the location to redirect. just the destinatition. ! $self->update_redirect( ! $r->param("ispmanDomain"), ! $r->param("ispmanVhostName"), ! $r->param("ispmanVhostRedirectURL"), ! $r->param("ispmanVhostRedirectLocation") ! ); ! } else { ! #hmm, lets delete the old entry and create a new one. ! #the entry DN is dependant on the location ! my $oldDN=$self->getRedirectionDN($r->param("ispmanDomain"), ! $r->param("ispmanVhostName"), $r->param("modifyURL")); ! if ($self->deleteEntry($oldDN)){ ! return $self->addRedirect($r); ! } ! } $r->param("section", "redirects"); $self->editVhost($r); } sub update_redirect { my $self=shift; ! my ($domain, $vhost, $ispmanVhostRedirectURL, $ispmanVhostRedirectLocation)=@_; my $dn=$self->getRedirectionDN($domain, $vhost, $ispmanVhostRedirectURL); --- 98,129 ---- sub updateRedirect { my $self=shift; my $r=shift; ! $self->update_redirect( ! $r->param("ispmanDomain"), ! $r->param("ispmanVhostName"), ! $r->param("ispmanVhostRedirectURL"), ! $r->param("ispmanVhostRedirectLocation"), ! $r->param("modifyURL") ! ); ! $r->param("section", "redirects"); $self->editVhost($r); } + sub update_redirect { + # update redirection is + # delete Old Entry + # create new entry my $self=shift; ! my ($domain, $vhost, $ispmanVhostRedirectURL, $ispmanVhostRedirectLocation, $oldURL)=@_; + if ($oldURL && $oldURL ne $ispmanVhostRedirectURL) { + $self->delete_redirect($domain, $vhost, $oldURL); + return $self->add_redirect($domain, $vhost, $ispmanVhostRedirectURL, $ispmanVhostRedirectLocation); + } + my $dn=$self->getRedirectionDN($domain, $vhost, $ispmanVhostRedirectURL); |