ispCP - Board - Support
Domain alias forward edition - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: Suggestions (/forum-2.html)
+--- Thread: Domain alias forward edition (/thread-953.html)

Pages: 1 2


Domain alias forward edition - greg - 07-11-2007 03:04 PM

I don't like the actual form that show domains alias and the system for enable/disable the forward.

The main problem is that the domain alias list don't show the forward url ! We can only see if a forward is set or not with the enable/disable switch (and it's not very clear to understand). But if a forward exist, the redirect url can't be see...

Worst of all, if you click on disable, then the forward is deleted, and you never see the url... no confirmation about this action, and you can only enable the forward again... if you know what the mystery url must be !

I have two little modifications to propose (i'm working with the last nightly) :
Code:
file /var/www/ispcp/gui/reseller/edit_alias.php, line 65 :
//    check_for_disable($_GET['edit_id']);

file /var/www/ispcp/gui/reseller/domain_alias.php, line 346 :
//              $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');

I just comment this two lines to avoid the auto-deletion of existing alias (then you can edit it, and set it to 'no' to disable) and to show the forward url instead of 'disable'/'enable'

Of course the same things would be made into the custumer interface, maybe like this :

file /var/www/ispcp/gui/client/manage_domains.php :
Code:
function gen_user_als_forward($als_id, $als_status, $url_forward)
{
  global $cfg;

  if ($url_forward === 'no') {
    if ($als_status === 'ok') {
//      return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
      return array(tr('None'), "enable_als_fwd.php?id=$als_id");
    } else {
      return array(tr('N/A'), '#');
    }
  } else {
    if ($als_status === 'ok') {
//    return array(tr('Disable'), "disable_als_fwd.php?id=$als_id");
      return array($url_forward, "enable_als_fwd.php?id=$als_id");
    } else {
      return array(tr('N/A'), '#');
    }
  }
}

What do you think about it ?


RE: Domain alias forward edition - BeNe - 07-11-2007 03:39 PM

This is a good idea!
Can you please create a Diff, open a Ticket and put all in ?
Makes the developmet easier.

Thx & Greez
BeNe


RE: Domain alias forward edition - xister - 07-11-2007 03:48 PM

Very good idea Smile


RE: Domain alias forward edition - greg - 07-11-2007 04:20 PM

I have created a new ticket : http://www.isp-control.net/ispcp/ticket/475
(it's a funny enhancement as my modifications are mainly remove of actual code)

But when I try to upload my diff file as an attachment, I have a Trac error :
Code:
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/trac/attachment.py", line 361, in process_request
    self._do_save(req, attachment)
  File "/usr/lib/python2.4/site-packages/trac/attachment.py", line 496, in _do_save
    attachment.insert(filename, upload.file, size)
  File "/usr/lib/python2.4/site-packages/trac/attachment.py", line 180, in insert
    os.makedirs(self.path)
  File "os.py", line 159, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/www/virtual/inetcentral.de/trac/htdocs/ispcp/attachments/ticket/475'

So I put my diff file in this post !


RE: Domain alias forward edition - Zothos - 07-11-2007 07:12 PM

very nice Smile

+1 for getting this into the trunk Tongue


RE: Domain alias forward edition - raphael - 07-12-2007 06:29 AM

Quote:114c114,115
< return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
---
> // return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
> return array(tr('None'), "enable_als_fwd.php?id=$als_id");
Is there any reason for this change?

same for this one:
Quote:< $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');
---
> // $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');

I will review the modifications further this afternoon


RE: Domain alias forward edition - greg - 07-12-2007 07:11 AM

For this one :
Code:
<                 $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');
---
> //                $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');

It's because I prefer to have the url of the forward directly in the domain alias list instead of 'disable' / 'enable'. I think it's more useful to have 'http://forward-domain.tld' / 'no'

So I try to make the same thing into the customer GUI :
Code:
<       return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
---
> //      return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
>       return array(tr('None'), "enable_als_fwd.php?id=$als_id");

As I replace 'Disable' by the forward url, I think it's better to have 'None' instead of 'Enable'


RE: Domain alias forward edition - raphael - 07-12-2007 07:20 AM

greg Wrote:For this one :
Code:
<                 $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');
---
> //                $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');

It's because I prefer to have the url of the forward directly in the domain alias list instead of 'disable' / 'enable'. I think it's more useful to have 'http://forward-domain.tld' / 'no'

Don't you think this would be better?:
Code:
<                 $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');
---
>                $als_fwd = ($als_fwd == 'no') ? tr('disabled') : $als_fwd;

resulting in this change to be useless:
Code:
<       return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
---
> //      return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
>       return array(tr('None'), "enable_als_fwd.php?id=$als_id");



RE: Domain alias forward edition - greg - 07-12-2007 08:49 AM

raphael Wrote:Don't you think this would be better?:
Code:
<                 $als_fwd = ($als_fwd == 'no') ? tr('disabled') : tr('enabled');
---
>                $als_fwd = ($als_fwd == 'no') ? tr('disabled') : $als_fwd;
Yes you could only replace the 'no' by 'disabled', this is okay for me.

raphael Wrote:resulting in this change to be useless:
Code:
<       return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
---
> //      return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
>       return array(tr('None'), "enable_als_fwd.php?id=$als_id");
In this case, I think this is better to change like this (to use the same logic) :
Code:
<       return array(tr('Enable'), "enable_als_fwd.php?id=$als_id");
---
>       return array(tr('Disabled'), "enable_als_fwd.php?id=$als_id");



RE: Domain alias forward edition - raphael - 07-12-2007 09:56 AM

sounds good