api.sigreq.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <?php
  2. /**
  3. * Base signup requests handling class
  4. */
  5. class SignupRequests {
  6. /**
  7. * Contains available signup requests
  8. *
  9. * @var array
  10. */
  11. protected $requests = array();
  12. /**
  13. * Contains system alter config as key=>value
  14. *
  15. * @var array
  16. */
  17. protected $altcfg = array();
  18. /**
  19. * System message helper object placeholder
  20. *
  21. * @var object
  22. */
  23. protected $messages = '';
  24. /**
  25. * Default whois service URL
  26. */
  27. const URL_WHOIS = '?module=whois&ip=';
  28. /**
  29. * Default module URL
  30. */
  31. const URL_ME = '?module=sigreq';
  32. /**
  33. * Creates new sigreq instance
  34. *
  35. * @return void
  36. */
  37. public function __construct() {
  38. $this->loadAlter();
  39. $this->initMessages();
  40. }
  41. /**
  42. * loads actual alter config into private property
  43. *
  44. * @return void
  45. */
  46. protected function loadAlter() {
  47. global $ubillingConfig;
  48. $this->altcfg = $ubillingConfig->getAlter();
  49. }
  50. /**
  51. * Inits system messages helper object
  52. *
  53. * @return void
  54. */
  55. protected function initMessages() {
  56. $this->messages = new UbillingMessageHelper();
  57. }
  58. /**
  59. * loads signup requests into private data property
  60. *
  61. * @return void
  62. */
  63. protected function loadRequests() {
  64. $query = "SELECT * from `sigreq` ORDER BY `id` DESC;";
  65. $allreqs = simple_queryall($query);
  66. if (!empty($allreqs)) {
  67. $this->requests = $allreqs;
  68. }
  69. }
  70. /**
  71. * renders available signups data
  72. *
  73. * @return void
  74. */
  75. public function renderAjListData() {
  76. $this->loadRequests();
  77. $result = '';
  78. $jsonAAData = array();
  79. $telepathy = new Telepathy(false, true, true);
  80. //additional comments indicator
  81. if ($this->altcfg['ADCOMMENTS_ENABLED']) {
  82. $adcomments = new ADcomments('SIGREQ');
  83. }
  84. if (!empty($this->requests)) {
  85. foreach ($this->requests as $io => $eachreq) {
  86. $jsonItem = array();
  87. $jsonItem[] = $eachreq['id'];
  88. $jsonItem[] = $eachreq['date'];
  89. $jsonItem[] = wf_Link(self::URL_WHOIS . $eachreq['ip'], $eachreq['ip']);
  90. if (empty($eachreq['apt'])) {
  91. $apt = 0;
  92. } else {
  93. $apt = $eachreq['apt'];
  94. }
  95. $reqaddr = $eachreq['street'] . ' ' . $eachreq['build'] . '/' . $apt;
  96. $loginDetect = $telepathy->getLogin($reqaddr);
  97. $profileLink = (!empty($loginDetect)) ? ' ' . wf_Link('?module=userprofile&username=' . $loginDetect, web_profile_icon()) : '';
  98. $jsonItem[] = $reqaddr . $profileLink;
  99. $jsonItem[] = $eachreq['realname'];
  100. $jsonItem[] = $eachreq['phone'];
  101. if ($this->altcfg['ADCOMMENTS_ENABLED']) {
  102. $commIndicator = ' ' . $adcomments->getCommentsIndicator($eachreq['id']);
  103. } else {
  104. $commIndicator = '';
  105. }
  106. $actlinks = wf_Link('?module=sigreq&showreq=' . $eachreq['id'], wf_img('skins/icon_search_small.gif') . ' ' . __('Show'), true, '');
  107. $jsonItem[] = web_bool_led($eachreq['state']) . $commIndicator;
  108. $jsonItem[] = $actlinks;
  109. $jsonAAData[] = $jsonItem;
  110. }
  111. }
  112. $result = array("aaData" => $jsonAAData);
  113. die(json_encode($result));
  114. }
  115. /**
  116. * Render requests list
  117. *
  118. * @return void
  119. */
  120. public function renderList() {
  121. //check database configuration table
  122. if (zb_CheckTableExists('sigreqconf')) {
  123. if (cfr('SIGREQCONF')) {
  124. $confControl = wf_Link('?module=sigreq&settings=true', wf_img('skins/settings.png', __('Settings')), false) . ' ';
  125. } else {
  126. $confControl = '';
  127. }
  128. } else {
  129. $confControl = '';
  130. }
  131. $viewControl = wf_Link('?module=sigreq&calendarview=true', wf_img('skins/icon_calendar.gif', __('As calendar')), false, '');
  132. $columns = array(__('ID'), __('Date'), __('IP'), __('Full address'), __('Real Name'), __('Phone'), __('Processed'), __('Actions'));
  133. $opts = '"order": [[ 0, "desc" ]]';
  134. $result = wf_JqDtLoader($columns, self::URL_ME . '&ajlist=true', false, __('Signup requests'), 100, $opts);
  135. show_window($confControl . __('Available signup requests') . ' ' . $viewControl, $result);
  136. }
  137. /**
  138. * renders available signups data in calendar view
  139. *
  140. * @return void
  141. */
  142. public function renderCalendar() {
  143. $query = "SELECT * from `sigreq` ORDER BY `date` ASC";
  144. $all = simple_queryall($query);
  145. $result = '';
  146. $calendarData = '';
  147. if (!empty($all)) {
  148. foreach ($all as $io => $each) {
  149. $timestamp = strtotime($each['date']);
  150. $date = date("Y, n-1, j", $timestamp);
  151. $rawTime = date("H:i:s", $timestamp);
  152. if ($each['state'] == 0) {
  153. $coloring = "className : 'undone',";
  154. } else {
  155. $coloring = '';
  156. }
  157. $calendarData.="
  158. {
  159. title: '" . $rawTime . ' ' . $each['street'] . ' ' . $each['build'] . '/' . $each['apt'] . "',
  160. url: '?module=sigreq&showreq=" . $each['id'] . "',
  161. start: new Date(" . $date . "),
  162. end: new Date(" . $date . "),
  163. " . $coloring . "
  164. },
  165. ";
  166. }
  167. }
  168. $result = wf_FullCalendar($calendarData);
  169. //check database configuration table
  170. if (zb_CheckTableExists('sigreqconf')) {
  171. $confControl = wf_Link('?module=sigreq&settings=true', wf_img('skins/settings.png', __('Settings')), false) . ' ';
  172. } else {
  173. $confControl = '';
  174. }
  175. $viewControl = wf_Link('?module=sigreq', wf_img('skins/icon_table.png', __('Grid view')), false, '');
  176. show_window($confControl . __('Available signup requests') . ' ' . $viewControl, $result);
  177. }
  178. /**
  179. * returns signup request data by selected ID
  180. *
  181. * @param int $requid Existing signup request ID
  182. *
  183. * @return array
  184. */
  185. protected function getData($reqid) {
  186. $requid = vf($reqid, 3);
  187. $query = "SELECT * from `sigreq` WHERE `id`='" . $reqid . "'";
  188. $result = simple_query($query);
  189. return($result);
  190. }
  191. /**
  192. * shows selected signup request by its ID
  193. *
  194. * @param int $requid Existing signup request ID
  195. *
  196. * @return void
  197. */
  198. public function showRequest($reqid) {
  199. $requid = vf($reqid, 3);
  200. $reqdata = $this->getData($reqid);
  201. if (empty($reqdata['apt'])) {
  202. $apt = 0;
  203. } else {
  204. $apt = $reqdata['apt'];
  205. }
  206. $shortaddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt;
  207. $taskCreateControls = wf_modal(wf_img('skins/createtask.gif', __('Create task')), __('Create task'), ts_TaskCreateFormSigreq($shortaddress, $reqdata['phone']), '', '420', '500');
  208. $cells = wf_TableCell(__('Date'));
  209. $cells.=wf_TableCell($reqdata['date'] . ' ' . $taskCreateControls);
  210. $rows = wf_TableRow($cells, 'row3');
  211. $whoislink = self::URL_WHOIS . $reqdata['ip'];
  212. $iplookup = wf_Link($whoislink, $reqdata['ip'], false, '');
  213. $cells = wf_TableCell(__('IP'));
  214. $cells.=wf_TableCell($iplookup);
  215. $rows.= wf_TableRow($cells, 'row3');
  216. $reqAddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt;
  217. //Construct capability create form if enabled
  218. if ($this->altcfg['CAPABDIR_ENABLED']) {
  219. $capabDir = new CapabilitiesDirectory(true);
  220. $capabCreateForm = $capabDir->createForm($reqAddress, $reqdata['phone'], $reqdata['service'] . ' ' . $reqdata['notes']);
  221. $capabControl = wf_modal(wf_img_sized('skins/icon_cake.png', __('Available connection capabilities'), 10), __('Create connection capability'), $capabCreateForm, '', '400', '300');
  222. } else {
  223. $capabControl = '';
  224. }
  225. $cells = wf_TableCell(__('Full address'));
  226. $cells.=wf_TableCell($reqAddress . ' ' . $capabControl);
  227. $rows.= wf_TableRow($cells, 'row3');
  228. $cells = wf_TableCell(__('Real Name'));
  229. $cells.=wf_TableCell($reqdata['realname']);
  230. $rows.= wf_TableRow($cells, 'row3');
  231. $cells = wf_TableCell(__('Phone'));
  232. $cells.=wf_TableCell($reqdata['phone']);
  233. $rows.= wf_TableRow($cells, 'row3');
  234. $cells = wf_TableCell(__('Service'));
  235. $cells.=wf_TableCell($reqdata['service']);
  236. $rows.=wf_TableRow($cells, 'row3');
  237. $cells = wf_TableCell(__('Processed'));
  238. $cells.=wf_TableCell(web_bool_led($reqdata['state']));
  239. $rows.=wf_TableRow($cells, 'row3');
  240. $cells = wf_TableCell(__('Notes'));
  241. $notes = nl2br($reqdata['notes']);
  242. $notes = str_replace('Tariff:', __('Tariff') . ':', $notes);
  243. $notes = str_replace('Email:', __('Email') . ':', $notes);
  244. $cells.=wf_TableCell($notes);
  245. $rows.=wf_TableRow($cells, 'row3');
  246. $result = wf_TableBody($rows, '100%', '0', 'glamour');
  247. $actlinks = wf_BackLink('?module=sigreq');
  248. if (cfr('SIGREQEDIT')) {
  249. if ($reqdata['state'] == 0) {
  250. $actlinks.=wf_Link('?module=sigreq&reqdone=' . $reqid, wf_img_sized('skins/icon_active.gif', '', '10') . ' ' . __('Close'), false, 'ubButton');
  251. } else {
  252. $actlinks.=wf_Link('?module=sigreq&requndone=' . $reqid, wf_img_sized('skins/icon_inactive.gif', '', '10') . ' ' . __('Open'), false, 'ubButton');
  253. }
  254. }
  255. if (cfr('SIGREQDELETE')) {
  256. $deletelink = ' ' . wf_JSAlert("?module=sigreq&deletereq=" . $reqid, web_delete_icon(), $this->messages->getDeleteAlert());
  257. } else {
  258. $deletelink = '';
  259. }
  260. show_window(__('Signup request') . ': ' . $reqid . $deletelink, $result);
  261. show_window('', $actlinks);
  262. //additional comments
  263. if ($this->altcfg['ADCOMMENTS_ENABLED']) {
  264. $adcomments = new ADcomments('SIGREQ');
  265. show_window(__('Additional comments'), $adcomments->renderComments($requid));
  266. }
  267. }
  268. /**
  269. * Marks signup request as done in database
  270. *
  271. * @param int $reqid Existing request ID
  272. *
  273. * @return void
  274. */
  275. public function setDone($reqid) {
  276. $requid = vf($reqid, 3);
  277. simple_update_field('sigreq', 'state', '1', "WHERE `id`='" . $reqid . "'");
  278. log_register('SIGREQ DONE [' . $reqid . ']');
  279. }
  280. /**
  281. * Marks signup request as undone in database
  282. *
  283. * @param int $reqid Existing request ID
  284. *
  285. * @return void
  286. */
  287. public function setUnDone($reqid) {
  288. $requid = vf($reqid, 3);
  289. simple_update_field('sigreq', 'state', '0', "WHERE `id`='" . $reqid . "'");
  290. log_register('SIGREQ UNDONE [' . $reqid . ']');
  291. }
  292. /**
  293. * Deletes signup request as done in database
  294. *
  295. * @param int $reqid Existing request ID
  296. *
  297. * @return void
  298. */
  299. public function deleteReq($reqid) {
  300. $requid = vf($reqid, 3);
  301. $query = "DELETE from `sigreq` WHERE `id`='" . $reqid . "'";
  302. nr_query($query);
  303. log_register('SIGREQ DELETE [' . $reqid . ']');
  304. }
  305. /**
  306. * Gets all undone requests count, used by taskbar notifier
  307. *
  308. * @return int
  309. */
  310. public function getAllNewCount() {
  311. $query = "SELECT COUNT(`id`) from `sigreq` WHERE `state`='0'";
  312. $result = simple_query($query);
  313. $result = $result['COUNT(`id`)'];
  314. return ($result);
  315. }
  316. }
  317. /**
  318. * sigreq configuration class
  319. */
  320. class SignupConfig {
  321. protected $configRaw = array();
  322. public function __construct() {
  323. $this->loadConfig();
  324. }
  325. /**
  326. * Loads sigreqconf config from database
  327. *
  328. * @return void
  329. */
  330. protected function loadConfig() {
  331. $query = "SELECT * from `sigreqconf`";
  332. $all = simple_queryall($query);
  333. if (!empty($all)) {
  334. foreach ($all as $io => $each) {
  335. $this->configRaw[$each['key']] = $each['value'];
  336. }
  337. }
  338. }
  339. /**
  340. * checks key existance into raw config array
  341. *
  342. * @param string $key key value to check
  343. *
  344. * @return bool
  345. */
  346. protected function checkConf($key) {
  347. if (isset($this->configRaw[$key])) {
  348. return (true);
  349. } else {
  350. return (false);
  351. }
  352. }
  353. /**
  354. * deletes key from database config
  355. *
  356. * @param string $key key to delete from database config
  357. *
  358. * @return void
  359. */
  360. protected function deleteConf($key) {
  361. $key = mysql_real_escape_string($key);
  362. $query = "DELETE from `sigreqconf` WHERE `key`='" . $key . "';";
  363. nr_query($query);
  364. }
  365. /**
  366. * creates/replaces config key with some data into database config
  367. *
  368. * @param string $key key set data
  369. * @param string $data value data to set
  370. *
  371. * @return void
  372. */
  373. protected function setConf($key, $data) {
  374. $key = mysql_real_escape_string($key);
  375. $data = mysql_real_escape_string($data);
  376. $this->deleteConf($key);
  377. $query = "INSERT INTO `sigreqconf` (`id`, `key`, `value`) VALUES (NULL, '" . $key . "', '" . $data . "'); ";
  378. nr_query($query);
  379. }
  380. /**
  381. * checks diff key text data
  382. *
  383. * @param string $key key to check
  384. * @param string $data data to check diff
  385. *
  386. * @return bool
  387. */
  388. protected function diffConf($key, $data) {
  389. if (isset($this->configRaw[$key])) {
  390. if ($this->configRaw[$key] == $data) {
  391. return (false);
  392. } else {
  393. return (true);
  394. }
  395. } else {
  396. return (true);
  397. }
  398. }
  399. /**
  400. * renders editing form
  401. *
  402. * @return string
  403. */
  404. public function renderForm() {
  405. $inputs = '';
  406. $cityDispFlag = $this->checkConf('CITY_DISPLAY');
  407. $citySelFlag = $this->checkConf('CITY_SELECTABLE');
  408. $streetSelFlag = $this->checkConf('STREET_SELECTABLE');
  409. $emailDispFlag = $this->checkConf('EMAIL_DISPLAY');
  410. $spamDispFlag = $this->checkConf('SPAM_TRAPS');
  411. $cachingFlag = $this->checkConf('CACHING');
  412. $inputs.= wf_CheckInput('newcitydisplay', __('Display city input'), true, $cityDispFlag);
  413. $inputs.= wf_CheckInput('newcityselectable', __('Show city input as combobox'), true, $citySelFlag);
  414. $inputs.= wf_CheckInput('newstreetselectable', __('Show street input as combobox'), true, $streetSelFlag);
  415. $inputs.= wf_CheckInput('newemaildisplay', __('Display email field'), true, $emailDispFlag);
  416. $inputs.= wf_CheckInput('newespamtraps', __('Render spambots protection traps'), true, $spamDispFlag);
  417. $inputs.= wf_CheckInput('newcaching', __('Database connections caching'), true, $cachingFlag);
  418. $inputs.= wf_TextInput('newispname', __('Your ISP Name'), @$this->configRaw['ISP_NAME'], true, 25);
  419. $inputs.= wf_TextInput('newispurl', __('Your ISP site URL'), @$this->configRaw['ISP_URL'], true, 25);
  420. $inputs.= wf_TextInput('newisplogo', __('Your ISP logo URL'), @$this->configRaw['ISP_LOGO'], true, 25);
  421. $inputs.= wf_tag('label') . __('Sidebar text - contacts, phones etc.') . ' (HTML)' . wf_tag('label', true) . wf_tag('br');
  422. $inputs.= wf_TextArea('newsidebartext', '', @$this->configRaw['SIDEBAR_TEXT'], true, '50x10');
  423. $inputs.= wf_tag('label') . __('Greeting text') . ' (HTML)' . wf_tag('label', true) . wf_tag('br');
  424. $inputs.= wf_TextArea('newgreetingtext', '', @$this->configRaw['GREETING_TEXT'], true, '50x5');
  425. $inputs.= wf_TextInput('newservices', __('Services offered') . ' ' . __('(separator - comma)'), @$this->configRaw['SERVICES'], true, 25);
  426. $inputs.= wf_TextInput('newtariffs', __('Tariffs offered') . ' ' . __('(separator - comma)'), @$this->configRaw['TARIFFS'], true, 25);
  427. $inputs.= wf_TextInput('newhideouts', __('City and streets hide lists') . ' ' . __('(separator - comma)'), @$this->configRaw['HIDEOUTS'], true, 25);
  428. $inputs.= wf_HiddenInput('changesettings', 'true');
  429. $inputs.= wf_delimiter();
  430. $inputs.= wf_Submit(__('Save'));
  431. $result = wf_Form('', 'POST', $inputs, 'glamour');
  432. $result.= wf_BackLink('?module=sigreq');
  433. return ($result);
  434. }
  435. /**
  436. * saves config to database if needed
  437. *
  438. * @return void
  439. */
  440. public function save() {
  441. //city display
  442. if (isset($_POST['newcitydisplay'])) {
  443. if (!$this->checkConf('CITY_DISPLAY')) {
  444. $this->setConf('CITY_DISPLAY', 'NOP');
  445. log_register('SIGREQCONF ENABLED CITY_DISPLAY');
  446. }
  447. } else {
  448. if ($this->checkConf('CITY_DISPLAY')) {
  449. $this->deleteConf('CITY_DISPLAY');
  450. log_register('SIGREQCONF DISABLED CITY_DISPLAY');
  451. }
  452. }
  453. //city combobox
  454. if (isset($_POST['newcityselectable'])) {
  455. if (!$this->checkConf('CITY_SELECTABLE')) {
  456. $this->setConf('CITY_SELECTABLE', 'NOP');
  457. log_register('SIGREQCONF ENABLED CITY_SELECTABLE');
  458. }
  459. } else {
  460. if ($this->checkConf('CITY_SELECTABLE')) {
  461. $this->deleteConf('CITY_SELECTABLE');
  462. log_register('SIGREQCONF DISABLED CITY_SELECTABLE');
  463. }
  464. }
  465. //street combobox
  466. if (isset($_POST['newstreetselectable'])) {
  467. if (!$this->checkConf('STREET_SELECTABLE')) {
  468. $this->setConf('STREET_SELECTABLE', 'NOP');
  469. log_register('SIGREQCONF ENABLED STREET_SELECTABLE');
  470. }
  471. } else {
  472. if ($this->checkConf('STREET_SELECTABLE')) {
  473. $this->deleteConf('STREET_SELECTABLE');
  474. log_register('SIGREQCONF DISABLED STREET_SELECTABLE');
  475. }
  476. }
  477. //mail input
  478. if (isset($_POST['newemaildisplay'])) {
  479. if (!$this->checkConf('EMAIL_DISPLAY')) {
  480. $this->setConf('EMAIL_DISPLAY', 'NOP');
  481. log_register('SIGREQCONF ENABLED EMAIL_DISPLAY');
  482. }
  483. } else {
  484. if ($this->checkConf('EMAIL_DISPLAY')) {
  485. $this->deleteConf('EMAIL_DISPLAY');
  486. log_register('SIGREQCONF DISABLED EMAIL_DISPLAY');
  487. }
  488. }
  489. //spamtraps
  490. if (isset($_POST['newespamtraps'])) {
  491. if (!$this->checkConf('SPAM_TRAPS')) {
  492. $this->setConf('SPAM_TRAPS', 'NOP');
  493. log_register('SIGREQCONF ENABLED SPAM_TRAPS');
  494. }
  495. } else {
  496. if ($this->checkConf('SPAM_TRAPS')) {
  497. $this->deleteConf('SPAM_TRAPS');
  498. log_register('SIGREQCONF DISABLED SPAM_TRAPS');
  499. }
  500. }
  501. //caching
  502. if (isset($_POST['newcaching'])) {
  503. if (!$this->checkConf('CACHING')) {
  504. $this->setConf('CACHING', 'NOP');
  505. log_register('SIGREQCONF ENABLED CACHING');
  506. }
  507. } else {
  508. if ($this->checkConf('CACHING')) {
  509. $this->deleteConf('CACHING');
  510. log_register('SIGREQCONF DISABLED CACHING');
  511. }
  512. }
  513. //isp name
  514. if (isset($_POST['newispname'])) {
  515. if ($this->diffConf('ISP_NAME', $_POST['newispname'])) {
  516. $this->setConf('ISP_NAME', $_POST['newispname']);
  517. log_register('SIGREQCONF CHANGED ISP_NAME');
  518. }
  519. }
  520. //isp url
  521. if (isset($_POST['newispurl'])) {
  522. if ($this->diffConf('ISP_URL', $_POST['newispurl'])) {
  523. $this->setConf('ISP_URL', $_POST['newispurl']);
  524. log_register('SIGREQCONF CHANGED ISP_URL');
  525. }
  526. }
  527. //isp logo
  528. if (isset($_POST['newisplogo'])) {
  529. if ($this->diffConf('ISP_LOGO', $_POST['newisplogo'])) {
  530. $this->setConf('ISP_LOGO', $_POST['newisplogo']);
  531. log_register('SIGREQCONF CHANGED ISP_LOGO');
  532. }
  533. }
  534. //sidebar
  535. if (isset($_POST['newsidebartext'])) {
  536. if ($this->diffConf('SIDEBAR_TEXT', $_POST['newsidebartext'])) {
  537. $this->setConf('SIDEBAR_TEXT', $_POST['newsidebartext']);
  538. log_register('SIGREQCONF CHANGED SIDEBAR_TEXT');
  539. }
  540. }
  541. //greeting
  542. if (isset($_POST['newgreetingtext'])) {
  543. if ($this->diffConf('GREETING_TEXT', $_POST['newgreetingtext'])) {
  544. $this->setConf('GREETING_TEXT', $_POST['newgreetingtext']);
  545. log_register('SIGREQCONF CHANGED GREETING_TEXT');
  546. }
  547. }
  548. //services
  549. if (isset($_POST['newservices'])) {
  550. if ($this->diffConf('SERVICES', $_POST['newservices'])) {
  551. $this->setConf('SERVICES', $_POST['newservices']);
  552. log_register('SIGREQCONF CHANGED SERVICES');
  553. }
  554. }
  555. //tariffs
  556. if (isset($_POST['newtariffs'])) {
  557. if ($this->diffConf('TARIFFS', $_POST['newtariffs'])) {
  558. $this->setConf('TARIFFS', $_POST['newtariffs']);
  559. log_register('SIGREQCONF CHANGED TARIFFS');
  560. }
  561. }
  562. //hideouts
  563. if (isset($_POST['newhideouts'])) {
  564. if ($this->diffConf('HIDEOUTS', $_POST['newhideouts'])) {
  565. $this->setConf('HIDEOUTS', $_POST['newhideouts']);
  566. log_register('SIGREQCONF CHANGED HIDEOUTS');
  567. }
  568. }
  569. }
  570. }
  571. ?>