AffordableDomainsCanada Posted March 28, 2017 Share Posted March 28, 2017 I took a look around the forums and couldnt find anything related to this topic. But I am creating a page in WHMCS, and I am using the basic method outlined on https://developers.whmcs.com/advanced/creating-pages/ Is there a way I can make it so ONLY administrators logged in can view this pages content? 0 Quote Link to comment Share on other sites More sharing options...
wulfric Posted March 28, 2017 Share Posted March 28, 2017 Admin specific huh? Hmm...I know this works really well, and I love using these tags in the .tpl files, but this is only relevent to registered users... not admins. {if $loggedin} only logged in users see this {else} if you are logged out you see this {/if} Maybe if you added {debug} to top of your .tpl file, you can inspect the popup and see if they have "admin specific" stuff that you could extend upon. This would be my hopefuly guess: {if $loggedin.admin} only admin stuff {/if} http://docs.whmcs.com/Administrators_and_Permissions https://developers.whmcs.com/hooks-reference/output/ https://developers.whmcs.com/hooks-reference/admin-area/ 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted March 28, 2017 Author Share Posted March 28, 2017 Admin specific huh? Hmm...I know this works really well, and I love using these tags in the .tpl files, but this is only relevent to registered users... not admins. {if $loggedin} only logged in users see this {else} if you are logged out you see this {/if} Maybe if you added {debug} to top of your .tpl file, you can inspect the popup and see if they have "admin specific" stuff that you could extend upon. This would be my hopefuly guess: {if $loggedin.admin} only admin stuff {/if} http://docs.whmcs.com/Administrators_and_Permissions https://developers.whmcs.com/hooks-reference/output/ https://developers.whmcs.com/hooks-reference/admin-area/ Your not far off, the smarty variable is actually $adminLoggedIn I dont want to use IF Statements as someone could still access the .tpl file to get the information. I am looking to create a page for my administrators where they can find other site login information which as you can image is sensitive info and I don't want just anyone being able to view this info. I am thinking of creating a table in the db, and having the page pull the data from the database. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 28, 2017 Share Posted March 28, 2017 perhaps you should be looking to use an Addon Module instead - that will likely be more secure and part of the admin area... https://developers.whmcs.com/addon-modules/ Addon modules allow you to create both admin pages and hooks to extend WHMCS further.Addon Modules can consist of just an admin page, just hooks, or both. They are all managed through the Setup > Addon Modules interface. 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted March 28, 2017 Author Share Posted March 28, 2017 perhaps you should be looking to use an Addon Module instead - that will likely be more secure and part of the admin area... https://developers.whmcs.com/addon-modules/ hehe I was trying to create this within my realm of knowledge. I dont know a whole lot about creating addon modules and I know this would be more of a custom thing and getting help will be tricky (dont really want to hire someone). I will see what I can come up with.. Please bare with me if I have a lot of questions.. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 28, 2017 Share Posted March 28, 2017 I am looking to create a page for my administrators where they can find other site login information which as you can image is sensitive info and I don't want just anyone being able to view this info.I am thinking of creating a table in the db, and having the page pull the data from the database. that's not necessarily a bad idea and I can see the logic behind it... how much information are you talking about showing? e.g is it short/brief enough that it can be output as an admin widget on the admin homepage?? that way you don't need additional pages/modules and you'll know they'd need to be logged in as an admin (with correct permissions) to view the output... they'd also be no template to protect as the widget would be generated by the hook. hehe I was trying to create this within my realm of knowledge. I dont know a whole lot about creating addon modules and I know this would be more of a custom thing and getting help will be tricky (dont really want to hire someone). feeling a little frugal, Jason?! 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted March 28, 2017 Author Share Posted March 28, 2017 I am going to attempt the module approach. See what I can come up with. I would prefer it to be a separate page then a widget. the homepage now is already cramped with garbage I don't need to add more to it. All I am looking at outputting to the page is Website: Username: email: password: All the information would be stored in a table in the database. I don't want a admin section where the information is added, this will be done manually by editing the database, as once I have it setup I will just have to edit the passwords every month. But then I also got thinking.. a feature that would be nice is the ability to set who can view which login based on permissions. but i feel that is way to complicated for me and could be a future update to this potential module. I came across this sample module also, I am going to take a look at it and see what I can do with it. https://github.com/WHMCS/sample-addon-module 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.