tecwithquestion

Well-Known Member
Oct 20, 2014
65
2
58
cPanel Access Level
Root Administrator
Hello,

I have added below code in the index.tt file

[% IF quota_info.inodes_used < 600000 %]
<span class="text-success"><i class="fas fa-check-square" aria-hidden="true"></i></span>
[% ELSE %]

Here I want to add the conditoin.

If the package is ABC, the I want to show inode count 250000

What change I need need to make here?


Thanks
 
Last edited by a moderator:

cPanelThomas

Developer
Feb 16, 2023
32
23
83
cPanel
cPanel Access Level
Root Administrator
Without knowing more about specifically what index.tt file you are referring to (maybe a full path?), I'll probably not be able to give a good answer to this. I can't really know what variable the package name is going to be stored in if I can't figure out the context here.

Can you also reply with what version of cPanel you are working with and what theme (paper_lantern or jupiter) is in use? Knowing these things will help me narrow down the correct answer.
 

tecwithquestion

Well-Known Member
Oct 20, 2014
65
2
58
cPanel Access Level
Root Administrator
Oh I am sorry.
cpanel version is 110.0.2 and I am using Jupiter theme.
The path of index file is : /usr/local/cpanel/base/frontend/jupiter/tools/index.tt
The package name is Startup.
 

cPanelThomas

Developer
Feb 16, 2023
32
23
83
cPanel
cPanel Access Level
Root Administrator
So, the variable you will want to reference in this file would be `CPANEL.CPDATA.PLAN`, as that would correspond to the logged in user's package name. For reference, the CPANEL.CPDATA variable is just a hash table of the contents of `/var/cpanel/users/$user` where `$user` would be whoever happens to be logged in.

With that you'd probably want an if block like

[% IF CPANEL.CPDATA.PLAN == 'Startup' %]
[% quota_info.inodes_used = 250000 %]
[% END %]

And that ought to set the inodes_used parameter in the way you specified earlier (presuming I understood you correctly). Hope this helps!
 
  • Like
Reactions: cPRex

cPanelThomas

Developer
Feb 16, 2023
32
23
83
cPanel
cPanel Access Level
Root Administrator
So long as the IF block for manipulating the value in quota_info.inodes_used from my previous post is keying on CPANEL.CPDATA.PLAN being equal to 'Startup', I don't see how that would be a problem. Other packages should retain the original value based on the logic there.
 

tecwithquestion

Well-Known Member
Oct 20, 2014
65
2
58
cPanel Access Level
Root Administrator
I managed by using below code

[% IF CPANEL.CPDATA.PLAN == 'ABC' %]
[% quota_info.inodes_limit = 250000 %]
[% ELSE %]
[% quota_info.inodes_limit = 600000 %]
[% END %]

Once again thank you for your help Thomas!
 
  • Like
Reactions: cPRex