public function DoPost()
 {
     if (isset($_POST['next_btn'])) {
         if (5 > strlen(trim(CPost::Get('txtPassword1', '')))) {
             CSession::Set('wm_install_pass_error', 'Minimum password length is 5 characters.');
         } else {
             if (CPost::Get('txtPassword1', '') !== CPost::Get('txtPassword2', '')) {
                 CSession::Set('wm_install_pass_error', 'The password and its confirmation don\'t match.');
             } else {
                 $this->oSettings->SetConf('Common/AdminPassword', md5(CPost::Get('txtPassword1', '')));
                 return $this->oSettings->SaveToXml();
             }
         }
     }
     return false;
 }
Beispiel #2
0
 protected function initDbSettings()
 {
     $this->oSettings->SetConf('Common/DBType', 'PostgreSQL' === CPost::get('chSqlType') ? EDbType::PostgreSQL : EDbType::MySQL);
     if (CPost::Has('txtSqlLogin')) {
         $this->oSettings->SetConf('Common/DBLogin', CPost::get('txtSqlLogin'));
     }
     if (CPost::Has('txtSqlPassword') && API_DUMMY !== (string) CPost::get('txtSqlPassword')) {
         $this->oSettings->SetConf('Common/DBPassword', CPost::get('txtSqlPassword'));
     }
     if (CPost::Has('txtSqlName')) {
         $this->oSettings->SetConf('Common/DBName', CPost::get('txtSqlName'));
     }
     if (CPost::Has('txtSqlSrc')) {
         $this->oSettings->SetConf('Common/DBHost', CPost::get('txtSqlSrc'));
     }
     if (CPost::Has('prefixString')) {
         $this->oSettings->SetConf('Common/DBPrefix', CPost::get('prefixString'));
     }
     $this->oSettings->SaveToXml();
 }