예제 #1
0
 public function TemplateValues()
 {
     $sFootError = '';
     if (CSession::Has('wm_install_pass_error')) {
         $sFootError = CSession::Get('wm_install_pass_error', '');
         CSession::Clear('wm_install_pass_error');
     }
     return array('Login' => $this->oSettings->GetConf('Common/AdminLogin'), 'Password1' => '', 'Password2' => '', 'FootError' => $sFootError);
 }
예제 #2
0
 public function TemplateValues()
 {
     $sTestDbText = '';
     if (isset($_SESSION['wm_install_db_test_error'])) {
         $sTestDbText = '<span class="error">' . $_SESSION['wm_install_db_test_error'] . '</span>';
         unset($_SESSION['wm_install_db_test_error']);
     } else {
         if (isset($_SESSION['wm_install_db_test_message'])) {
             $sTestDbText = '<span class="success">' . $_SESSION['wm_install_db_test_message'] . '</span>';
             unset($_SESSION['wm_install_db_test_message']);
         }
     }
     $sCreateDBNameText = '';
     if (isset($_SESSION['wm_install_db_name_create_error'])) {
         $sCreateDBNameText = '<span class="error">' . $_SESSION['wm_install_db_name_create_error'] . '</span>';
         unset($_SESSION['wm_install_db_name_create_error']);
     } else {
         if (isset($_SESSION['wm_install_db_name_create_message'])) {
             $sCreateDBNameText = '<span class="success">' . $_SESSION['wm_install_db_name_create_message'] . '</span>';
             unset($_SESSION['wm_install_db_name_create_message']);
         }
     }
     $sMainFootText = '';
     if (isset($_SESSION['wm_install_db_foot_error'])) {
         $sMainFootText = '<span class="error">' . $_SESSION['wm_install_db_foot_error'] . '</span>';
         unset($_SESSION['wm_install_db_foot_error']);
     }
     return array('SqlTypeMySQLCheched' => EDbType::MySQL === $this->oSettings->GetConf('Common/DBType') ? 'checked="cheched"' : '', 'SqlTypePostgreSQLCheched' => EDbType::PostgreSQL === $this->oSettings->GetConf('Common/DBType') ? 'checked="cheched"' : '', 'Login' => $this->oSettings->GetConf('Common/DBLogin'), 'Password' => API_DUMMY, 'DbName' => $this->oSettings->GetConf('Common/DBName'), 'Host' => $this->oSettings->GetConf('Common/DBHost'), 'prefix' => $this->oSettings->GetConf('Common/DBPrefix'), 'CreateDbCheched' => isset($_SESSION['wm-install-create-db']) ? '' : 'checked="cheched"', 'CreateDBNameText' => $sCreateDBNameText, 'TestDBText' => $sTestDbText, 'MainFootText' => $sMainFootText);
 }
예제 #3
0
 /**
  * @param CApiGlobalManager &$oManager
  */
 public function __construct(CApiGlobalManager &$oManager)
 {
     parent::__construct('carddav', $oManager);
     CApi::Inc('common.dav.client');
     $this->Dav = null;
     $this->Settings = CApi::GetSettings();
     $this->Pdo = CApi::GetPDO();
     $this->User = null;
     $this->Account = null;
     $this->Connected = false;
     $this->aAddressBooksCache = array();
     $this->aGroupItemsCache = array();
     $this->ContactsCache = array();
     $this->GroupsCache = array();
     $this->DbPrefix = $this->Settings->GetConf('Common/DBPrefix');
     $this->ApiUsersManager = CApi::Manager('users');
     $this->ApiDavManager = CApi::Manager('dav');
 }
예제 #4
0
 /**
  * @return bool
  */
 public function ConnectSlave()
 {
     try {
         if ($this->oSlaveConnector->IsConnected()) {
             return true;
         }
         $this->oSlaveConnector->ReInitIfNotConnected($this->oSettings->GetConf('Common/DBHost'), $this->oSettings->GetConf('Common/DBLogin'), $this->oSettings->GetConf('Common/DBPassword'), $this->oSettings->GetConf('Common/DBName'));
         return $this->oSlaveConnector->Connect(true, true);
     } catch (CApiDbException $oException) {
         $this->SetException($oException);
     }
     return false;
 }
예제 #5
0
 /**
  * @return bool
  */
 protected function saveSettingsXmlWithMessage()
 {
     return $this->checkBolleanWithMessage($this->oSettings->SaveToXml());
 }