Jump to content

Function Getclienttabs($Package)'s Returned Array Elements


ModulesBakery

Recommended Posts

Hi there,

I have a feature request for the function getClientTabs($package)'s returned array elements.

 

Currently this function's returned array elements will still be shown in the client area even if the service is not active while i guess if the service is suspended/pending/canceled the client should not be able to view any of them, for example the stats tab in the cPanel Module.

Link to comment
Share on other sites

There are instances where tabs from a module would be useful to clients, such as when a service is suspended. And simply removing the name of the tab from the list of client tabs would not stop clients from viewing the content if they chose to.

 

The content displayed in the tab, however, can be changed by the module. So instead of listing statistics, it could simply show a message that "No statistical information is available at this time."

Link to comment
Share on other sites

Normally , if the service is suspended , there no tab view renerated . let me test it now .

EDIT :

Ohh Nooo .... this for me is a big bug . why ?

if the servie is suspended , that mean the client has no access to this service , and the idea the coder/developper should add a condition to check if the service is suspended or not is too bad and ugly .

normally , if the client has the option to change/access the services tabs , why is suspended ?

the client can start the vps if is stopped due to the suspended action (this is just a samaple) .

if the service is suspended ,the manage button should the manage fucntion should return no data for clients . as if we just remove the manage button , the inteligent client can access the manage via the direct url .

client/services/manage/1988/tabxxxxx/

V2.5 was this feature , and no tabs are returned at all .

Link to comment
Share on other sites

uffff , ican't sleep today , i have almost finished all to migrat to v3 . with this behavior i can't imagine my new system .

SUSPENSION = client can't do anything in service .

@tyson/@cody/@paul , what is the difference between active and suspended services ?

from what i see , is just the red notice in the top of tabs .

Link to comment
Share on other sites

Normally , if the service is suspended , there no tab view renerated . let me test it now .

EDIT :

Ohh Nooo .... this for me is a big bug . why ?

if the servie is suspended , that mean the client has no access to this service , and the idea the coder/developper should add a condition to check if the service is suspended or not is too bad and ugly .

normally , if the client has the option to change/access the services tabs , why is suspended ?

the client can start the vps if is stopped due to the suspended action (this is just a samaple) .

if the service is suspended ,the manage button should the manage fucntion should return no data for clients . as if we just remove the manage button , the inteligent client can access the manage via the direct url .

client/services/manage/1988/tabxxxxx/

V2.5 was this feature , and no tabs are returned at all .

 

 

:)

 

 

There are instances where tabs from a module would be useful to clients, such as when a service is suspended. And simply removing the name of the tab from the list of client tabs would not stop clients from viewing the content if they chose to.

 

The content displayed in the tab, however, can be changed by the module. So instead of listing statistics, it could simply show a message that "No statistical information is available at this time."

 

Tyson,

 

As for the content displayed in the tab, in my own modules it is already taken care of, however, it took me a lot of time. While logically i believe it should be there by default (in the core), at least the simplest solution is just to pass the variable $service to that function.

 

As for the instances: well i don't think that there would be any need for any tab if the service is suspended (except for the service information tab), otherwise, if you want to give a client the access to these tabs why did you suspend the service in the first place ?

 

- Case #2: A client ordered a service (cpanel/interworx hosting for example or whatever) the order/service status is Pending (OR) In-review which means that the cPanel/Interworx account still not created yet, right? why even show these tabs to the client ?

 

- Case #3: Canceled order/service,  Why :)  ?

Link to comment
Share on other sites

@ModulesBakery , i have reported your tread as BUG .

 

i have found a solution . for those who want patch thier system , open app/controllers/client_services.php

 

 

change at line 943

// Get tabs
$client_tabs = $module->getClientTabs($package);

with

// Get tabs
if (!empty($service->date_suspended))
   $client_tabs = array() ;
else 
   $client_tabs = $module->getClientTabs($package);

EDIT :

and to prevent client from access to tabs with direct url 

 

change the line 123

$tab_view = $module->{$method}($package, $service, $this->get, $this->post, $this->files);

to

if (empty($service->date_suspended))
    $tab_view = $module->{$method}($package, $service, $this->get, $this->post, $this->files);

i can sleep now :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...