WEB_DOMAIN.class.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <?php
  2. /**
  3. * DOMAIN
  4. *
  5. * @author vesta, http://vestacp.com/
  6. * @author Dmitry Malishev <dima.malishev@gmail.com>
  7. * @author Dmitry Naumov-Socolov <naumov.socolov@gmail.com>
  8. * @copyright vesta 2010-2011
  9. */
  10. class WEB_DOMAIN extends AjaxHandler
  11. {
  12. public function getListExecute(Request $request)
  13. {
  14. $user = $this->getLoggedUser();
  15. $reply = array();
  16. $result = Vesta::execute(Vesta::V_LIST_WEB_DOMAINS, array('USER' => $user['uid']), self::JSON);
  17. $stat = array();
  18. $result_stat = Vesta::execute(Vesta::V_LIST_WEB_DOMAINS_STATS, array('USER' => $user['uid']), self::JSON);
  19. foreach ($result_stat['data'] as $w_d => $w_d_details) {
  20. $stat[$w_d] = $w_d_details;
  21. }
  22. foreach($result['data'] as $web_domain => $record)
  23. {
  24. $web_details = array(
  25. 'IP' => $record['IP'],
  26. 'U_DISK' => (int)$record['U_DISK'],
  27. 'U_BANDWIDTH' => (int)$record['U_BANDWIDTH'],
  28. 'TPL' => $record['TPL'],
  29. 'ALIAS' => @str_replace(",", ", ", $record['ALIAS']),
  30. 'PHP' => $record['PHP'],
  31. 'CGI' => $record['CGI'],
  32. 'ELOG' => $record['ELOG'],
  33. 'STAT' => $record['STATS'],
  34. 'STATS_LOGIN' => $record['STATS_AUTH'],
  35. 'SSL' => $record['SSL'] == 'yes' ? 'on' : 'off',
  36. 'SSL_HOME' => $record['SSL_HOME'] == 'tsingle' ? 'off' : 'on',
  37. 'SSL_CRT' => '',
  38. 'SSL_KEY' => '',
  39. 'SSL_CA' => '',
  40. 'NGINX' => $record['NGINX'],
  41. 'NGINX_EXT' => $record['NGINX_EXT'],
  42. 'SUSPEND' => $record['SUSPEND'] == 'on' ? 'on' : 'off',
  43. 'DATE' => date(Config::get('ui_date_format', strtotime($record['DATE'])))
  44. );
  45. $web_details['STAT'] == '' ? $web_details['STAT'] = 'none' : true;
  46. if($record['SSL'] == 'yes'){
  47. $result_ssl = Vesta::execute(Vesta::V_LIST_WEB_DOMAIN_SSL, array('USER' => $user['uid'], 'DOMAIN' => $web_domain, self::JSON));
  48. if($result_ssl['status']){
  49. foreach ($result_ssl['data'][$web_domain] as $key => $value) {
  50. $web_details['SSL_'.$key] = $value;
  51. }
  52. }
  53. }
  54. $reply[$web_domain] = $web_details;
  55. }
  56. if (!$result['status']) {
  57. $this->errors[] = array($result['error_code'] => $result['error_message']);
  58. }
  59. return $this->reply($result['status'], $reply);
  60. }
  61. public function addExecute(Request $request)
  62. {
  63. $_s = $request->getParameter('spell');
  64. $user = $this->getLoggedUser();
  65. $params = array(
  66. 'USER' => $user['uid'],
  67. 'DOMAIN' => $_s['DOMAIN'],
  68. 'IP' => $_s['IP']
  69. );
  70. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN, $params);
  71. if (!$result['status']) {
  72. $this->errors[] = array($result['error_code'] => $result['error_message']);
  73. }
  74. if (!empty($_s['TPL'])) {
  75. $params = array(
  76. 'USER' => $user['uid'],
  77. 'DOMAIN' => $_s['DOMAIN'],
  78. 'TPL' => $_s['TPL']
  79. );
  80. $result = 0;
  81. $result = Vesta::execute(Vesta::V_CHANGE_WEB_DOMAIN_TPL, $params);
  82. if (!$result['status']) {
  83. $this->errors['CHANGE_TPL'] = array($result['error_code'] => $result['error_message']);
  84. }
  85. }
  86. if (!empty($_s['ALIAS'])) {
  87. $alias = str_replace("\n", "", $_s['ALIAS']);
  88. $alias = str_replace("\n", "", $alias);
  89. foreach ($alias_arr as $alias) {
  90. $params = array(
  91. 'USER' => $user['uid'],
  92. 'DOMAIN' => $_s['DOMAIN'],
  93. 'ALIAS' => trim($alias)
  94. );
  95. $result = 0;
  96. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_ALIAS, $params);
  97. if (!$result['status']) {
  98. $this->errors['ALIAS'] = array($result['error_code'] => $result['error_message']);
  99. }
  100. }
  101. }
  102. if (!empty($_s['STATS']) && @$_s['STATS'] != 'none') {
  103. $params = array(
  104. 'USER' => $user['uid'],
  105. 'DOMAIN' => $_s['DOMAIN'],
  106. 'STAT' => $_s['STAT']);
  107. $result = 0;
  108. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_STAT, $params);
  109. if (!$result['status']) {
  110. $this->errors['STATS'] = array($result['error_code'] => $result['error_message']);
  111. }
  112. }
  113. if (!empty($_s['STAT_AUTH']) && @Utils::getCheckboxBooleanValue($_s['STATS_AUTH'])) {
  114. $params = array(
  115. 'USER' => $user['uid'],
  116. 'DOMAIN' => $_s['DOMAIN'],
  117. 'STAT_USER' => $_s['STAT_USER'],
  118. 'STAT_PASSWORS' => $_s['STAT_PASSWORD']
  119. );
  120. $result = 0;
  121. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_STAT_AUTH, $params);
  122. if(!$result['status'])
  123. $this->errors['STAT_AUTH'] = array($result['error_code'] => $result['error_message']);
  124. }
  125. if (!empty($_new['CGI'])) {
  126. if (Utils::getCheckboxBooleanValue($_new['CGI'])) {
  127. $result = array();
  128. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_CGI, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  129. if (!$result['status']) {
  130. $this->status = FALSE;
  131. $this->errors['ADD_CGI'] = array($result['error_code'] => $result['error_message']);
  132. }
  133. }
  134. }
  135. if (!empty($_new['ELOG'])) {
  136. if (Utils::getCheckboxBooleanValue($_new['ELOG'])) {
  137. $result = array();
  138. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_ELOG, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  139. if (!$result['status']) {
  140. $this->status = FALSE;
  141. $this->errors['ADD_ELOG'] = array($result['error_code'] => $result['error_message']);
  142. }
  143. }
  144. }
  145. if (($_s['DNS_DOMAIN']) == 'on') {
  146. echo 'adding dns domain';
  147. echo '<br>';
  148. $params = array(
  149. 'USER' => $user['uid'],
  150. 'DNS_DOMAIN' => $_s['DOMAIN'],
  151. 'IP' => $_s['IP']
  152. );
  153. require_once V_ROOT_DIR . 'api/DNS.class.php';
  154. $dns = new DNS();
  155. $result = 0;
  156. $result = $dns->addExecute($params);
  157. if (!$result['status']) {
  158. $this->errors['DNS_DOMAIN'] = array($result['error_code'] => $result['error_message']);
  159. }
  160. }
  161. /*if (!empty($_s['MAIL'])) {
  162. $params = array(
  163. 'USER' => $_user,
  164. 'MAIL_DOMAIN' => $_s['DOMAIN'],
  165. 'IP' => $_s['IP']
  166. );
  167. require_once V_ROOT_DIR . 'api/MAIL.class.php';
  168. $mail = new MAIL();
  169. $result = 0;
  170. $result = $mail->addExecute($params);
  171. if (!$result['status'])
  172. $this->errors['MAIL_DOMAIN'] = array($result['error_code'] => $result['error_message']);
  173. }*/
  174. if ($_s['SUSPEND'] == 'on') {
  175. if($result['status']){
  176. $result = array();
  177. $result = Vesta::execute(Vesta::V_SUSPEND_WEB_DOMAIN, array('USER' => $user['uid'], 'JOB' => $_s['DOMAIN']));
  178. if (!$result['status']) {
  179. $this->status = FALSE;
  180. $this->errors['SUSPEND'] = array($result['error_code'] => $result['error_message']);
  181. }
  182. }
  183. }
  184. return $this->reply($result['status'], $result['data']);
  185. }
  186. public function deleteExecute(Request $request)
  187. {
  188. $_s = $request->getParameter('spell');
  189. $user = $this->getLoggedUser();
  190. $params = array(
  191. 'USER' => $user['uid'],
  192. 'DOMAIN' => $_s['DOMAIN']
  193. );
  194. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN, $params);
  195. if (!$result['status']) {
  196. $this->errors[] = array($result['error_code'] => $result['error_message']);
  197. }
  198. $params = array(
  199. 'USER' => $_user,
  200. 'DNS_DOMAIN' => $_s['DOMAIN']
  201. );
  202. return $this->reply($result['status'], $result['data']);
  203. }
  204. public function changeExecute(Request $request)
  205. {
  206. $_s = $request->getParameter('spell');
  207. $_old = $request->getParameter('old');
  208. $_new = $request->getParameter('new');
  209. $_old['ELOG'] = $_old['ELOG'] == 'yes' ? 'on' : 'off';
  210. $_old['CGI'] = $_old['CGI'] == 'yes' ? 'on' : 'off';
  211. $_old['AUTH'] = $_old['AUTH'] == 'yes' ? 'on' : 'off';
  212. // $_old['SSL'] = $_old['SSL'] == 'yes' ? 'on' : 'off';
  213. // $_new['SSL'] = $_new['SSL'] == 'yes' ? 'on' : 'off';
  214. // $_new['SSL_HOME'] = $_new['SSL_HOME'] == 'no' ? 'shared' : 'single';
  215. $user = $this->getLoggedUser();
  216. $_DOMAIN = $_new['DOMAIN'];
  217. $result['status'] = TRUE;
  218. if ($_old['SUSPEND'] != $_new['SUSPEND']) {
  219. if ($_new['SUSPEND'] == 'on') {
  220. $result = Vesta::execute(Vesta::V_SUSPEND_WEB_DOMAIN, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  221. if (!$result['status']) {
  222. $this->status = FALSE;
  223. $this->errors['SUSPEND'] = array($result['error_code'] => $result['error_message']);
  224. }
  225. // return $this->reply($result['status']);
  226. }
  227. else {
  228. $result = Vesta::execute(Vesta::V_UNSUSPEND_WEB_DOMAIN, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  229. if (!$result['status']) {
  230. $this->status = FALSE;
  231. $this->errors['UNSUSPEND'] = array($result['error_code'] => $result['error_message']);
  232. }
  233. }
  234. if ($_new['SUSPEND'] == 'on') {
  235. $result = Vesta::execute(Vesta::V_SUSPEND_WEB_DOMAIN, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  236. if (!$result['status']) {
  237. $this->status = FALSE;
  238. $this->errors['SUSPEND'] = array($result['error_code'] => $result['error_message']);
  239. }
  240. // return $this->reply($result['status']);
  241. }
  242. else {
  243. $result = Vesta::execute(Vesta::V_UNSUSPEND_WEB_DOMAIN, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  244. if (!$result['status']) {
  245. $this->status = FALSE;
  246. $this->errors['UNSUSPEND'] = array($result['error_code'] => $result['error_message']);
  247. }
  248. }
  249. }
  250. if ($_old['IP'] != $_new['IP']) {
  251. $result = array();
  252. $result = Vesta::execute(Vesta::V_CHANGE_WEB_DOMAIN_IP, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN, 'IP' => $_new['IP']));
  253. if (!$result['status']) {
  254. $this->status = FALSE;
  255. $this->errors['IP_ADDRESS'] = array($result['error_code'] => $result['error_message']);
  256. }
  257. }
  258. if ($_old['TPL'] != $_new['TPL']) {
  259. $result = array();
  260. $result = Vesta::execute(Vesta::V_CHANGE_WEB_DOMAIN_TPL, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN, 'TPL' => $_new['TPL']));
  261. if (!$result['status']) {
  262. $this->status = FALSE;
  263. $this->errors['TPL'] = array($result['error_code'] => $result['error_message']);
  264. }
  265. }
  266. if ($_old['ALIAS'] != $_new['ALIAS']) {
  267. $result = array();
  268. $old_arr_raw = preg_split('/[,\s]/', $_old['ALIAS']);
  269. $new_arr_raw = preg_split('/[,\s]/', $_new['ALIAS']);
  270. $old_arr = array();
  271. $new_arr = array();
  272. foreach ($old_arr_raw as $alias) {
  273. if ('' != trim($alias)) {
  274. $old_arr[] = $alias;
  275. }
  276. }
  277. foreach ($new_arr_raw as $alias) {
  278. if ('' != trim($alias)) {
  279. $new_arr[] = $alias;
  280. }
  281. }
  282. $added = array_diff($new_arr, $old_arr);
  283. $deleted = array_diff($old_arr, $new_arr);
  284. foreach ($deleted as $alias) {
  285. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN_ALIAS, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN, 'ALIAS' => $alias));
  286. if (!$result['status']) {
  287. $this->status = FALSE;
  288. $this->errors['DEL_ALIAS'] = array($result['error_code'] => $result['error_message']);
  289. }
  290. }
  291. foreach ($added as $alias) {
  292. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_ALIAS, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN, 'ALIAS' => $alias));
  293. if (!$result['status']) {
  294. $this->status = FALSE;
  295. $this->errors['ADD_ALIAS'] = array($result['error_code'] => $result['error_message']);
  296. }
  297. }
  298. }
  299. if (($_old['STAT_AUTH'] != $_new['STAT_AUTH']) && !empty($_s['STAT_AUTH']) && @Utils::getCheckboxBooleanValue($_s['STATS_AUTH'])) {
  300. $params = array(
  301. 'USER' => $user['uid'],
  302. 'DOMAIN' => $_DOMAIN,
  303. 'STAT_USER' => $_new['STAT_USER'],
  304. 'STAT_PASSWORS' => $_new['STAT_PASSWORD']
  305. );
  306. $result = 0;
  307. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_STAT_AUTH, $params);
  308. if(!$result['status']) {
  309. $this->errors['STAT_AUTH'] = array($result['error_code'] => $result['error_message']);
  310. }
  311. }
  312. if (($_old['STAT'] != $_new['STAT'])) {
  313. if ($_new['STAT'] != 'none') {
  314. $result = array();
  315. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_STAT, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN, 'STAT' => $_new['STAT']));
  316. if (!$result['status']) {
  317. $this->status = FALSE;
  318. $this->errors['ADD_STAT'] = array($result['error_code'] => $result['error_message']);
  319. }
  320. }
  321. else {
  322. $result = array();
  323. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN_STAT, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  324. if (!$result['status']) {
  325. $this->status = FALSE;
  326. $this->errors['DEL_STAT'] = array($result['error_code'] => $result['error_message']);
  327. }
  328. $result = array();
  329. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN_STAT_AUTH, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN, 'STAT_USER' => $_new['STAT_USER']));
  330. if (!$result['status']) {
  331. $this->status = FALSE;
  332. $this->errors['DEL_STAT_AUTH'] = array($result['error_code'] => $result['error_message']);
  333. }
  334. }
  335. }
  336. if (($_old['CGI'] != $_new['CGI'])) {
  337. if (Utils::getCheckboxBooleanValue($_new['CGI'])) {
  338. $result = array();
  339. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_CGI, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  340. if (!$result['status']) {
  341. $this->status = FALSE;
  342. $this->errors['ADD_CGI'] = array($result['error_code'] => $result['error_message']);
  343. }
  344. }
  345. else {
  346. $result = array();
  347. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN_CGI, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  348. if (!$result['status']) {
  349. $this->status = FALSE;
  350. $this->errors['DEL_CGI'] = array($result['error_code'] => $result['error_message']);
  351. }
  352. }
  353. }
  354. if (($_old['ELOG'] != $_new['ELOG'])) {
  355. if (Utils::getCheckboxBooleanValue($_new['ELOG'])) {
  356. $result = array();
  357. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_ELOG, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  358. if (!$result['status']) {
  359. $this->status = FALSE;
  360. $this->errors['ADD_ELOG'] = array($result['error_code'] => $result['error_message']);
  361. }
  362. }
  363. else {
  364. $result = array();
  365. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN_ELOG, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  366. if (!$result['status']) {
  367. $this->status = FALSE;
  368. $this->errors['DEL_ELOG'] = array($result['error_code'] => $result['error_message']);
  369. }
  370. }
  371. }
  372. if (( !empty($_new['SSL_KEY']) && !empty($_new['SSL_CRT']) && $_new['SSL'] == 'on') || $_old['SSL_HOME'] != $_new['SSL_HOME']) {
  373. $ssl_dir = sys_get_temp_dir().'/';
  374. $ssl_crt_file = $ssl_dir . $_new['DOMAIN'] . '.crt';
  375. file_put_contents($ssl_crt_file, $_new['SSL_CRT']);
  376. $ssl_key_file = $ssl_dir . $_new['DOMAIN'] . '.key';
  377. file_put_contents($ssl_key_file, $_new['SSL_KEY']);
  378. if (!empty($_new['SSL_CA'])) {
  379. $ssl_ca_file = $ssl_dir . $_new['DOMAIN'] . '.ca';
  380. file_put_contents($ssl_ca_file, $_new['SSL_CA']);
  381. }
  382. $params = array(
  383. 'USER' => $user['uid'],
  384. 'DOMAIN' => $_DOMAIN,
  385. 'SSL_DIR' => $ssl_dir,
  386. 'SSL_HOME' => $_new['SSL_HOME'] == 'on' ? 'shared' : 'single'
  387. );
  388. $result = 0;
  389. if($_old['SSL'] == 'on'){
  390. $result = Vesta::execute(Vesta::V_CHANGE_WEB_DOMAIN_SSL, $params);
  391. }
  392. else{
  393. $result = Vesta::execute(Vesta::V_ADD_WEB_DOMAIN_SSL, $params);
  394. }
  395. if (!$result['status']) {
  396. $this->errors['SSL'] = array($result['error_code'] => $result['error_message']);
  397. }
  398. unlink($ssl_crt_file);
  399. unlink($ssl_key_file);
  400. unlink($ssl_ca_file);
  401. }
  402. if ( ((empty($_new['SSL_KEY']) || empty($_new['SSL_CRT'])) && $_old['SSL'] == 'on') || ( $_old['SSL'] == 'on' && $_new['SSL'] == 'off') ){
  403. $result = 0;
  404. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN_SSL, array('USER' => $user['uid'], 'DOMAIN' => $_DOMAIN));
  405. if (!$result['status']) {
  406. $this->errors['SSL_REMOVING'] = array($result['error_code'] => $result['error_message']);
  407. }
  408. }
  409. return $this->reply($result['status'], $result['data']);
  410. }
  411. public function suspendExecute(Request $request)
  412. {
  413. $_s = $request->getParameter('spell');
  414. $user = $this->getLoggedUser();
  415. $params = array(
  416. 'USER' => $user['uid'],
  417. 'DOMAIN' => $_s['DOMAIN']
  418. );
  419. $result = Vesta::execute(Vesta::V_SUSPEND_WEB_DOMAIN, $params);
  420. if (!$result['status']) {
  421. $this->errors[] = array($result['error_code'] => $result['error_message']);
  422. }
  423. return $this->reply($result['status'], $result['data']);
  424. }
  425. public function unsuspendExecute(Request $request)
  426. {
  427. $_s = $request->getParameter('spell');
  428. $user = $this->getLoggedUser();
  429. $params = array(
  430. 'USER' => $user['uid'],
  431. 'DOMAIN' => $_s['DOMAIN']
  432. );
  433. $result = Vesta::execute(Vesta::V_UNSUSPEND_WEB_DOMAIN, $params);
  434. if (!$result['status']) {
  435. $this->errors[] = array($result['error_code'] => $result['error_message']);
  436. }
  437. return $this->reply($result['status'], $result['data']);
  438. }
  439. public function massiveSuspendExecute(Request $request)
  440. {
  441. $user = $this->getLoggedUser();
  442. $_entities = $request->getParameter('entities');
  443. foreach($_entities as $entity){
  444. $result = Vesta::execute(Vesta::V_SUSPEND_WEB_DOMAIN, array('USER' => $user['uid'], $entity['DOMAIN']));
  445. }
  446. return $this->reply($result['status'], $result['data']);
  447. }
  448. public function massiveUnsuspendExecute(Request $request)
  449. {
  450. $user = $this->getLoggedUser();
  451. $_entities = $request->getParameter('entities');
  452. foreach($_entities as $entity){
  453. $result = Vesta::execute(Vesta::V_UNSUSPEND_WEB_DOMAIN, array('USER' => $user['uid'], $entity['DOMAIN']));
  454. }
  455. return $this->reply($result['status'], $result['data']);
  456. }
  457. public function massiveDeleteExecute(Request $request)
  458. {
  459. $user = $this->getLoggedUser();
  460. $_entities = $request->getParameter('entities');
  461. foreach($_entities as $entity){
  462. $result = Vesta::execute(Vesta::V_DEL_WEB_DOMAIN, array('USER' => $user['uid'], $entity['DOMAIN']));
  463. }
  464. return $this->reply($result['status'], $result['data']);
  465. }
  466. }