Jump to content

Cody

Blesta Developers
  • Posts

    1,574
  • Joined

  • Last visited

  • Days Won

    74

Posts posted by Cody

  1. i have checked the client/admin side , and i found the same result as you, the return is sent to both admin and client side , even if the condition exist in my code .

    so all possibilities i have tried , and i'm now 99% sur the output is not controlled in wich side should returned (admin-client) .

    @Cody any explication about this ? or our result is true , then no way now to controle wich side should the output show .

    from docs this code should make output to client side only .

    $params = $event->getParams(); // get any set data previoslly , to not overide other plugin data

    $params['portal'] = "client"; // injest the markup in client side structure

    $event->setParams($params); // send array of new params with old and new data .

     

    You're using the params wrong for this event.

  2. Didn't I post how to use this event in another thread?

    <?php
    class MyPluginPlugin extends Plugin {
     
        ...
     
        public function getEvents() {
            return array(
                array(
                    'event' => "Appcontroller.structure",
                    'callback' => array("this", "run")
                )
                // Add multiple events here
            );
        }
     
        public function run($event) {
            // Fetch current return val
            $result = $event->getReturnVal();
    
            $params = $event->getParams();
            
            // Set return val if not set
            if (!isset($result['body_start']))
                    $result['body_start'] = null;
    
            // Update return val -- ONLY set if client portal
            if ($params['portal'] == "client")
                $result['body_start'] .= "<p>your HTML goes here</p>";
            
            // Update return val
            $event->setReturnVal($result);
            
            
        }
    }
    ?>
    

    See Plugin Events. Creating Events.

  3. Sorry for the late reply, We used the command and backups were generated (but not via blesta)

     

    Did you run the mysqldump command using the same user that your webserver runs as? That's probably your problem right there. The user that the webserver runs as is either:

     

    • Unable to execute mysqldump, or
    • Unable to write to the temp directory you have configured in Blesta.
  4. If submitting your username at /admin/login/reset/ does not produce an email in the log_email table then the username you provided doesn't match any staff user. Remember, your username is not necessarily your email address. Look in the users table for your admin user. Note the id, then look in the staff table for a staff user with that same id set for the user_id field. If you don't find on, that user is not a staff member.

  5. You should probably be using Company::setSetting() instead, since plugins are installed per-company.

     

    Also, you can use setSettings() after you create the settings for quick update. But install/uninstall could just loop through all settings your plugin creates.

    $settings = array('setting1', 'setting2', 'setting3');
    
    // uninstall all plugin settings:
    foreach ($settings as $setting) {
        $this->Company->unsetSetting($company_id, $setting);
    }
    
  6. Well I was just asking what the correct script to do it in was...... seems like it runs off of the index.php file in the root dir?

     

    Set the max execution time in your php.ini file. On most machines, there is not max execution time in CLI mode, so if you're running cron using something like /usr/bin/php instead of wget, then timeout is not the issue here.

  7. Docs here.

    $return = $event->getReturnVal();
    
    if (!array_key_exists("head", $return))
        $return['head'] = null;
    if (!array_key_exists("body_start", $return))
        $return['body_start'] = null;
    if (!array_key_exists("body_end", $return))
        $return['body_end'] = null;
    
    $return['head'] .= "<script>alert('head');</script>"
    $return['body_start'] .= "<p>Set at top of body</p>";
    $return['body_end'] .= "<p>Set at bottom of body</p>";
    
    $event->setReturnVal($return);
    

    But now that I think about it more, I'm thinking maybe each section should be an array. So instead you could just do:
     

    $return = $event->getReturnVal();
    
    $return['head'][] "<script>alert('head');</script>"
    $return['body_start'][] "<p>Set at top of body</p>";
    $return['body_end'][] "<p>Set at bottom of body</p>";
    
    $event->setReturnVal($return);
    

    Which is easier to use, and a little harder to accidentally overwrite other plugin's return values. What do you think?

  8. Blesta assumes the mysqldump binary is in the system path (e.g. executable from anywhere).

     

    Try the following command (replacing HOST, USER, PASSWORD, and DATABASENAME) with their appropriate values.

    mysqldump --host="HOST" --user="USER" --password="PASSWORD" DATABASENAME > dump.sql
    
  9. Great news.... Seems we are not far from the final release ;) By the way. There Is nothing In the betas folder ; I'm logged

     

    You have to have a license under your account to have access to betas.

  10. Version 3.3.0-b1 is now available. You can download it in the Client Area.

    This is a BETA feature release. This release is not considered stable enough for production use. Please report any bugs in the 3.3 beta bug forum.

    Installing Blesta

    See Installing Blesta in the User Manual for instructions.

    Upgrading Blesta

    See Upgrading Blesta in the User Manual for instructions.

    Release Notes

    See Blesta Core - Version 3.3.0-b1.

    For older releases see all Change Logs.

×
×
  • Create New...