Processes window events and handles user interactions.
84 {
86
89
90 switch ($id) {
92 $bearsamppWinbinder->setText(
95 );
96 $bearsamppWinbinder->setEnabled($this->wbBtnSave[
WinBinder::CTRL_OBJ], empty($serverName) ?
false :
true);
97 break;
100 if ($documentRoot && is_dir($documentRoot)) {
101 $bearsamppWinbinder->setText($this->wbInputDocRoot[
WinBinder::CTRL_OBJ], $documentRoot .
'\\');
102 $bearsamppWinbinder->setText(
105 );
106
108 }
109 break;
111 $bearsamppWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_SAVE + 1);
112 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
113
115 $bearsamppWinbinder->messageBoxError(
118 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
119 break;
120 }
121
122 if ($serverName != $this->initServerName && is_file(
$bearsamppRoot->getVhostsPath() .
'/' . $serverName .
'.conf')) {
123 $bearsamppWinbinder->messageBoxError(
126 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
127 break;
128 }
129
130
131 $bearsamppOpenSsl->removeCrt($this->initServerName);
132 @unlink(
$bearsamppRoot->getVhostsPath() .
'/' . $this->initServerName .
'.conf');
133
134 if ($bearsamppOpenSsl->createCrt($serverName) && file_put_contents(
$bearsamppRoot->getVhostsPath() .
'/' . $serverName .
'.conf',
$bearsamppBins->getApache()->getVhostContent($serverName, $documentRoot)) !==
false) {
135 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
136
138 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
139
140 $bearsamppWinbinder->messageBoxInfo(
143 $bearsamppWinbinder->destroyWindow($window);
144 } else {
145 $bearsamppWinbinder->messageBoxError(
148 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
149 }
150
152
153 break;
155 $bearsamppWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_DELETE + 1);
156
158 $confirm = $bearsamppWinbinder->messageBoxYesNo(
160 $boxTitle);
161
162 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
163
164 if ($confirm) {
165 if ($bearsamppOpenSsl->removeCrt($this->initServerName) && @unlink(
$bearsamppRoot->getVhostsPath() .
'/' . $this->initServerName .
'.conf')) {
166 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
167
169 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
170
171 $bearsamppWinbinder->messageBoxInfo(
173 $boxTitle);
174 $bearsamppWinbinder->destroyWindow($window);
175 } else {
176 $bearsamppWinbinder->messageBoxError(
178 $boxTitle);
179 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
180 }
181 }
182 break;
183 case IDCLOSE:
185 $bearsamppWinbinder->destroyWindow($window);
186 break;
187 }
188 }
const VHOST_CREATED_ERROR
const VHOST_NOT_VALID_DOMAIN
const VHOST_ALREADY_EXISTS
const VHOST_DOC_ROOT_PATH
static getActionRestart($sName)
static isValidDomainName($domainName)