This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Client Notice Manager
#1
Client Notice Manager
Hi there to all.

I need to make a few changes in the client notice manager for my hosting users, by checking some of the forum searches i found a post that provided me the location of the file, now i need to make it html and not just plain text, does anyone knows how? I paste there the code, any help will be much appreciated. 

Client Notice Manager:

Code:
<?php

class ui_tpl_notice {

   public static function Template() {
       $user_array = ctrl_users::GetUserDetail();
       global $zdbh;
       $result = $zdbh->query("SELECT ac_notice_tx FROM x_accounts WHERE ac_id_pk = " . $user_array['resellerid'] . "")->Fetch();
       if ($result) {
           if ($result['ac_notice_tx'] <> "")
               return ui_sysmessage::shout(
                   runtime_xss::xssClean($result['ac_notice_tx']),
                   'notice',
                   'Notice:',
                   true
               );
           return false;
       } else {
           return false;
       }
   }

}

?>
'' Life is full of important choices ''
Help Sentora Donate now => http://sentora.org/donate Blush
Reply
Thanks given by:
#2
RE: Client Notice Manager
http://forums.sentora.org/showthread.php...1#pid12941

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by: wormsunited
#3
RE: Client Notice Manager
SECURITY NOTICE: By disabling the check mentioned in the link, you may be vulnerable to malicious XSS and other possible security risks. Use at your own risk!
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: wormsunited
#4
RE: Client Notice Manager
Thanks to you all, it really works and i managed to protect myself using some of my own php scripts Wink

Huge thanks to the community and special thanks to: @TGates and @Ron-e
'' Life is full of important choices ''
Help Sentora Donate now => http://sentora.org/donate Blush
Reply
Thanks given by:
#5
RE: Client Notice Manager
(06-24-2016, 09:46 AM)wormsunited Wrote: Thanks to you all, it really works and i managed to protect myself using some of my own php scripts Wink

Can you post the solution you found, maybe other like to use it also or can work upon it.

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by:
#6
RE: Client Notice Manager
I am so sorry for my delay folks.
Here is the code i used, made my edits and then i changed back, instructions provided in the comments (fully commented)

PHP Code:
<?php

/**
 * @copyright 2014-2015 Sentora Project (http://www.sentora.org/) 
 * Sentora is a GPL fork of the ZPanel Project whose original header follows:
 *
 * Generic template place holder class.
 * @package zpanelx
 * @subpackage dryden -> ui -> tpl
 * @version 1.1.0
 * @author Bobby Allen (ballen@bobbyallen.me)
 * @copyright ZPanel Project (http://www.zpanelcp.com/)
 * @link http://www.zpanelcp.com/
 * @license GPL (http://www.gnu.org/licenses/gpl.html)
 *
 *
 * File location: /etc/sentora/panel/dryden/ui/tpl/notice.class.php
 * Edited by wormsunited = Help Sentora, donate now (http://sentora.org/donate)
 * Remove the code on line 34 of this code
 * CODE: runtime_xss::xssClean($result['ac_notice_tx'] = To plain text
 * CODE: ($result['ac_notice_tx']                      = For HTML tags
 * 
 * ATTENTION: USE AT YOUR OWN RISK
 *
 */
class ui_tpl_notice {

 
   public static function Template() {
 
       $user_array ctrl_users::GetUserDetail();
 
       global $zdbh;
 
       $result $zdbh->query("SELECT ac_notice_tx FROM x_accounts WHERE ac_id_pk = " $user_array['resellerid'] . "")->Fetch();
 
       if ($result) {
 
           if ($result['ac_notice_tx'] <> "")
 
               return ui_sysmessage::shout(
 
                   ($result['ac_notice_tx']),
 
                   'notice',
 
                   // YOU CAN ADD LINKS AND MORE HERE TOO
 
                   'Visit my website: <a href="http://google.com" target="_blank">Click here</a>',
 
                   true
                
);
 
           return false;
 
       } else {
 
           return false;
 
       }
 
   }

}

?>


I hope this can help the community Wink
'' Life is full of important choices ''
Help Sentora Donate now => http://sentora.org/donate Blush
Reply
Thanks given by:
#7
RE: Client Notice Manager
Confused  That's exactly what I had done. There is still no protection for XSS and harmful javascript. Need to add something like HTMLPurifier to clean/control the input.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: wormsunited
#8
RE: Client Notice Manager
Cant agree more, you are right! If we need to add extra protection we need to create a new module for it, and make it accessible only by Admin or Reselers in Sentora Module Admin.

I am working on this module tho... Wink
'' Life is full of important choices ''
Help Sentora Donate now => http://sentora.org/donate Blush
Reply
Thanks given by:
#9
RE: Client Notice Manager
Cool, check into adding HTMLpurifier. I was doing the same thing but time has been limited. It should be very easy to do.
I have successfully added it to other projects.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
Disabling warning and notice logging in /var/sentora/logs/domains/* JSmith 0 2 ,468 01-02-2021, 07:50 PM
Last Post: JSmith
Update extplorer and panels client poseidon97 0 3 ,748 02-06-2020, 11:40 PM
Last Post: poseidon97
DNS Manager - Unable to find requested module! obrempong7 0 2 ,554 11-18-2019, 07:59 AM
Last Post: obrempong7

Forum Jump:


Users browsing this thread: 1 Guest(s)