Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-1089

cPanel Extended: Cron may fail to provision services due to "headers already sent" error via session

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.2.0-b1
    • Component/s: Modules
    • Labels:
      None

      Description

      When the cron attempts to provision a service, that service may fail to be provisioned due to session error:
      Error: session_start(): Cannot send session cache limiter - headers already
      sent (output started at /home/user/public_html/app/controllers/cron.php:2132)

      The module appears to load the Session component, which it should not do. References to the Session should be removed.

        Activity

        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        Fixed

        Show
        tyson Tyson Phillips (Inactive) added a comment - Fixed
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        To fix in the interim:

        Update /components/modules/cpanelextended/api/cpanel_api.php, and remove all white-space at the end of the file:
        Change from:
        "?>

        "

        To (no quotes):
        "?>"

        Update /components/modules/cpanelextended/cpanelextended.php to remove all references to "Session":
        Change (line 47) from:
        Loader::loadComponents($this, array("Input", "Json", "Session"));

        To:
        Loader::loadComponents($this, array("Input", "Json"));

        Delete the following (lines 1471-1478):
        if($success == true)
        {
        $this->Session->write("successmsg", "success");
        }
        /*else
        {
        $this->Session->write("errormsg", $data[0]["message"]);
        }*/

        Delete the following (lines 1522-1536):
        $successmsgs = $this->Session->read("successmsg");

        if($successmsgs)
        {
        $this->view->commonHeader .= '<div class="message_box" style="padding: 0 10px; width: 940px;" id="successmsg"><ul style="padding: 0;"><li class="message"><a href="#" class="cross_btn">×</a><p>'. Language::_('Cpe.misc.success', true) .'</p></li></ul></div>';
        $this->Session->clear("successmsg");
        }
        /*
        $errormsgs = $this->Session->read("errormsg");

        if($errormsgs)
        {
        $this->view->commonHeader .= '<div class="message_box" style="padding: 0 5px;"><ul style="padding: 0;"><li class="error"><a href="#" class="cross_btn">×</a><p>'. $this->Session->read("errormsg") .'</p></li></ul></div>';
        $this->Session->clear("errormsg");
        }*/

        Show
        tyson Tyson Phillips (Inactive) added a comment - To fix in the interim: Update /components/modules/cpanelextended/api/cpanel_api.php, and remove all white-space at the end of the file: Change from: "?> " To (no quotes): "?>" Update /components/modules/cpanelextended/cpanelextended.php to remove all references to "Session": Change (line 47) from: Loader::loadComponents($this, array("Input", "Json", "Session")); To: Loader::loadComponents($this, array("Input", "Json")); Delete the following (lines 1471-1478): if($success == true) { $this->Session->write("successmsg", "success"); } /*else { $this->Session->write("errormsg", $data [0] ["message"] ); }*/ Delete the following (lines 1522-1536): $successmsgs = $this->Session->read("successmsg"); if($successmsgs) { $this->view->commonHeader .= '<div class="message_box" style="padding: 0 10px; width: 940px;" id="successmsg"><ul style="padding: 0;"><li class="message"><a href="#" class="cross_btn">×</a><p>'. Language::_('Cpe.misc.success', true) .'</p></li></ul></div>'; $this->Session->clear("successmsg"); } /* $errormsgs = $this->Session->read("errormsg"); if($errormsgs) { $this->view->commonHeader .= '<div class="message_box" style="padding: 0 5px;"><ul style="padding: 0;"><li class="error"><a href="#" class="cross_btn">×</a><p>'. $this->Session->read("errormsg") .'</p></li></ul></div>'; $this->Session->clear("errormsg"); }*/

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/Apr/14