public function proc() { //reg::setKey('/users/errorCountCapcha', system::POST('errorCountCapcha')); reg::setKey('/users/errorCountBlock', system::POST('errorCountBlock')); reg::setKey('/users/reg', system::POST('reg', isBool)); reg::setKey('/users/activation', system::POST('activation', isBool)); reg::setKey('/users/confirm', system::POST('confirm', isBool)); reg::setKey('/users/ask_email', system::POST('ask_email', isBool)); //авторизация чере соц. сети reg::setKey('/users/twitter_bool', system::POST('twitter_bool'), isBool); reg::setKey('/users/twitter_id', system::POST('twitter_id'), isString); reg::setKey('/users/twitter_secret', system::POST('twitter_secret'), isString); reg::setKey('/users/vk_bool', system::POST('vk_bool'), isBool); reg::setKey('/users/vk_id', system::POST('vk_id'), isString); reg::setKey('/users/vk_secret', system::POST('vk_secret'), isString); reg::setKey('/users/ok_bool', system::POST('ok_bool'), isBool); reg::setKey('/users/ok_id', system::POST('ok_id'), isString); reg::setKey('/users/ok_public', system::POST('ok_public'), isString); reg::setKey('/users/ok_secret', system::POST('ok_secret'), isString); reg::setKey('/users/facebook_bool', system::POST('facebook_bool'), isBool); reg::setKey('/users/facebook_id', system::POST('facebook_id'), isString); reg::setKey('/users/facebook_secret', system::POST('facebook_secret'), isString); reg::setKey('/users/yandex_bool', system::POST('yandex_bool'), isBool); reg::setKey('/users/google_bool', system::POST('google_bool'), isBool); ui::MessageBox(lang::get('CONFIG_SAVE_OK'), lang::get('CONFIG_SAVE_OK_MSG')); reg::clearCache(); system::log(lang::get('CONFIG_LOG_SAVE'), warning); system::redirect('/users/settings'); }
public function proc() { reg::setKey('/subscription/count_mails', system::POST('count_mails', isInt)); reg::setKey('/subscription/count_mails_day', system::POST('count_mails_day', isInt)); reg::clearCache(); ui::MessageBox(lang::get('CONFIG_SAVE_OK'), lang::get('CONFIG_SAVE_OK_MSG')); system::redirect('/subscription/settings'); }
public function proc() { reg::setKey('/eshop/only_reg', system::POST('only_reg', isBool)); reg::setKey('/eshop/check_count', system::POST('check_count', isBool)); reg::setKey('/eshop/dubl_to_email', system::POST('dubl_to_email', isBool)); reg::setKey('/eshop/fisrt_state', system::POST('fisrt_state', isInt)); $min_count = system::POST('min_count', isInt); if (empty($min_count)) { $min_count = '0'; } reg::setKey('/eshop/min_count', $min_count); reg::clearCache(); ui::MessageBox(lang::get('CONFIG_SAVE_OK'), lang::get('CONFIG_SAVE_OK_MSG')); system::redirect('/eshop/settings'); }
public function proc() { reg::setKey('/core/gzip', system::POST('gzip', isBool)); reg::setKey('/core/delToTrash', system::POST('delToTrash', isBool)); reg::setKey('/core/scaleBigJpeg', system::POST('scaleBigJpeg', isBool)); reg::setKey('/core/sizeBigJpeg', system::POST('sizeBigJpeg', isInt)); reg::setKey('/core/noIE6', system::POST('noIE6', isBool)); reg::setKey('/core/noIE7', system::POST('noIE7', isBool)); reg::setKey('/core/noIE8', system::POST('noIE8', isBool)); reg::setKey('/core/noDelMiniTexts', system::POST('noDelMiniTexts', isBool)); // Загрузка ватермарка if (isset($_FILES['file_watermark']) && !empty($_FILES['file_watermark']['name'])) { if (system::fileExtIs($_FILES['file_watermark']['name'], array('png'))) { $watermark = system::copyFile($_FILES['file_watermark']['tmp_name'], $_FILES['file_watermark']['name'], '/upload/image'); } else { ui::MessageBox(lang::get('CONFIG_SAVE_ERROR'), lang::get('CONFIG_WATERMARK_ERROR')); } } if (!isset($watermark) && isset($_POST['watermark'])) { if (system::fileExtIs($_POST['watermark'], array('png')) || empty($_POST['watermark'])) { $watermark = system::checkVar($_POST['watermark'], isString); } else { ui::MessageBox(lang::get('CONFIG_SAVE_ERROR'), lang::get('CONFIG_WATERMARK_ERROR') . '123'); } } if (isset($watermark) && $watermark != reg::getKey('/core/watermark')) { reg::setKey('/core/watermark', $watermark); $this->deleteCacheWatermark($watermark); } // ****************** Сохранение доменов *************************** function changeDomain($id, $data) { $online = isset($data['d_online']) ? $data['d_online'] : 0; $isAdd = empty($id) ? true : false; $obj = new domain($id); $obj->setName($data['d_name']); $obj->setOnline($online); $obj->setDefLang($data['d_def_lang']); $obj->setEmail($data['d_email']); $obj->setSiteName($data['d_sitename']); $id = $obj->save(); if ($id === false) { ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText()); } else { if ($isAdd) { ui::MessageBox(lang::get('CONFIG_DOMAIN_ADD'), lang::get('CONFIG_DOMAIN_TEXT')); } } return true; } function delDomain($id) { $obj = new domain($id); if ($obj->delete() === false) { ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText()); } } $form = new uiMultiForm('domains'); $form->process('changeDomain', 'delDomain'); // ****************** Сохранение языков *************************** function changeLang($id, $data) { $isAdd = empty($id) ? true : false; $obj = new language($id); $obj->setName($data['l_name']); $obj->setPrefix($data['l_prefix']); $id = $obj->save(); if ($id === false) { ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText()); } else { if ($isAdd) { ui::MessageBox(lang::get('CONFIG_LANG_ADD'), lang::get('CONFIG_LANG_TEXT')); } } return true; } function delLang($id) { $obj = new language($id); if ($obj->delete() === false) { ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText()); } } $form = new uiMultiForm('langs'); $form->process('changeLang', 'delLang'); // Если в системе только один язык, сохраняем его данные в реестр для быстрой подгрузки if (count(languages::getAll(true)) == 1) { reg::setKey('/core/cur_lang/id', languages::get(1, true)->id()); reg::setKey('/core/cur_lang/prefix', languages::get(1, true)->getPrefix()); reg::setKey('/core/cur_lang/name', languages::get(1, true)->getName()); } else { reg::delKey('/core/cur_lang'); } // Если в системе только один домен, сохраняем его данные в реестр для быстрой подгрузки if (count(domains::getAll(true)) == 1) { reg::setKey('/core/cur_domain/id', domains::get(1, true)->id()); reg::setKey('/core/cur_domain/name', domains::get(1, true)->getName()); reg::setKey('/core/cur_domain/def_lang', domains::get(1, true)->getDefLang()); reg::setKey('/core/cur_domain/sitename', domains::get(1, true)->getSiteName()); reg::setKey('/core/cur_domain/email', domains::get(1, true)->getEmail()); reg::setKey('/core/cur_domain/online', domains::get(1, true)->online()); reg::setKey('/core/cur_domain/offline_msg', domains::get(1, true)->getOfflineMsg()); reg::setKey('/core/cur_domain/error_msg', domains::get(1, true)->getErrorMsg()); } else { reg::delKey('/core/cur_domain'); } ui::MessageBox(lang::get('CONFIG_SAVE_OK'), lang::get('CONFIG_SAVE_OK_MSG')); reg::clearCache(); system::log(lang::get('CONFIG_LOG_SAVE'), warning); system::redirect('/core/change'); }