Processes window events and handles user interactions.
83 {
85
88
89 switch ($id) {
91 $bearsamppWinbinder->setText(
94 );
95 $bearsamppWinbinder->setEnabled($this->wbBtnSave[
WinBinder::CTRL_OBJ], empty($serverName) ?
false : true);
96 break;
99 if ($documentRoot && is_dir($documentRoot)) {
100 $bearsamppWinbinder->setText($this->wbInputDocRoot[
WinBinder::CTRL_OBJ], $documentRoot .
'\\');
101 $bearsamppWinbinder->setText(
104 );
105
107 }
108 break;
110 $bearsamppWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_SAVE + 1);
111 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
112
114 $bearsamppWinbinder->messageBoxError(
117 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
118 break;
119 }
120
121 if ($serverName != $this->initServerName && is_file(
$bearsamppRoot->getVhostsPath() .
'/' . $serverName .
'.conf')) {
122 $bearsamppWinbinder->messageBoxError(
125 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
126 break;
127 }
128
129
130 $bearsamppOpenSsl->removeCrt($this->initServerName);
131 @unlink(
$bearsamppRoot->getVhostsPath() .
'/' . $this->initServerName .
'.conf');
132
133 if ($bearsamppOpenSsl->createCrt($serverName) && file_put_contents(
$bearsamppRoot->getVhostsPath() .
'/' . $serverName .
'.conf',
$bearsamppBins->getApache()->getVhostContent($serverName, $documentRoot)) !==
false) {
134 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
135
137 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
138
139 $bearsamppWinbinder->messageBoxInfo(
142 $bearsamppWinbinder->destroyWindow($window);
143 } else {
144 $bearsamppWinbinder->messageBoxError(
147 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
148 }
149
151
152 break;
154 $bearsamppWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_DELETE + 1);
155
157 $confirm = $bearsamppWinbinder->messageBoxYesNo(
159 $boxTitle);
160
161 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
162
163 if ($confirm) {
164 if ($bearsamppOpenSsl->removeCrt($this->initServerName) && @unlink(
$bearsamppRoot->getVhostsPath() .
'/' . $this->initServerName .
'.conf')) {
165 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
166
168 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
169
170 $bearsamppWinbinder->messageBoxInfo(
172 $boxTitle);
173 $bearsamppWinbinder->destroyWindow($window);
174 } else {
175 $bearsamppWinbinder->messageBoxError(
177 $boxTitle);
178 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
179 }
180 }
181 break;
182 case IDCLOSE:
184 $bearsamppWinbinder->destroyWindow($window);
185 break;
186 }
187 }
const VHOST_NOT_VALID_DOMAIN
const VHOST_CREATED_ERROR
const VHOST_DOC_ROOT_PATH
const VHOST_ALREADY_EXISTS
static getActionRestart($sName)
static isValidDomainName($domainName)