/**
  * Initialize Page
  */
 public function init()
 {
     parent::init();
     // Populate the form
     $this->smarty->assign("hostname", $this->get['server']->getHostName());
     // Set URL fields
     $this->setURLField("server", $this->get['server']->getID());
     try {
         $CSDBO = load_CPanelServerDBO($this->get['server']->getID());
         $this->smarty->assign("WHMUsername", $CSDBO->getUsername());
         $this->smarty->assign("accessHash", $CSDBO->getAccessHash());
     } catch (DBNoRowsFoundException $e) {
     }
 }
/**
 * Inser or Update a CPanelServerDBO
 *
 * @param CPanelServerDBO $dbo CPanelServerDBO to be added/updated
 * @return boolean True on success
 */
function addOrUpdate_CPanelServerDBO(CPanelServerDBO $dbo)
{
    try {
        load_CPanelServerDBO($dbo->getServerID());
        // Update
        update_CPanelServerDBO($dbo);
    } catch (DBNoRowsFoundException $e) {
        // Add
        add_CPanelServerDBO($dbo);
    }
}
Example #3
0
 /**
  * Get CPanel Server DBO
  *
  * Given a server DBO, retrieves the associated CPanel Server DBO
  *
  * @param ServerDBO The server to query
  */
 protected function getCPanelServerDBO(ServerDBO $serverDBO)
 {
     return load_CPanelServerDBO($serverDBO->getID());
 }