Example #1
0
 /**
  * Default action
  */
 public function index()
 {
     $language = OW::getLanguage();
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('gphotoviewer', 'admin_menu_general'));
     $item->setUrl(OW::getRouter()->urlForRoute('gphotoviewer.admin_config'));
     $item->setKey('general');
     $item->setIconClass('ow_ic_gear_wheel');
     $item->setOrder(0);
     $menu = new BASE_CMP_ContentMenu(array($item));
     $this->addComponent('menu', $menu);
     $configs = OW::getConfig()->getValues('gphotoviewer');
     $configSaveForm = new ConfigSaveForm();
     $this->addForm($configSaveForm);
     if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
         $res = $configSaveForm->process();
         OW::getFeedback()->info($language->text('gphotoviewer', 'settings_updated'));
         $this->redirect(OW::getRouter()->urlForRoute('gphotoviewer.admin_config'));
     }
     if (!OW::getRequest()->isAjax()) {
         $this->setPageHeading(OW::getLanguage()->text('gphotoviewer', 'admin_config'));
         $this->setPageHeadingIconClass('ow_ic_picture');
         $elem = $menu->getElement('general');
         if ($elem) {
             $elem->setActive(true);
         }
     }
     $configSaveForm->getElement('enablePhotoviewer')->setValue($configs['enable_photo_viewer']);
     $configSaveForm->getElement('downloadable')->setValue($configs['can_users_to_download_photos']);
     $configSaveForm->getElement('slideshowTime')->setValue($configs['slideshow_time_per_a_photo']);
 }
Example #2
0
 public function index()
 {
     $language = OW::getLanguage();
     $form = new SELECTGENDER_CLASS_SettingsForm();
     $this->addForm($form);
     //$form->getElement('sandboxMode')->setValue(OW::getConfig()->getValue('smsverification', 'sandboxMode'));
     $form->getElement('disMaleToMaleProfile')->setValue(OW::getConfig()->getValue('selectgender', 'disMaleToMaleProfile'));
     $form->getElement('disMaleToFemaleProfile')->setValue(OW::getConfig()->getValue('selectgender', 'disMaleToFemaleProfile'));
     $form->getElement('disFemaleToFemaleProfile')->setValue(OW::getConfig()->getValue('selectgender', 'disFemaleToFemaleProfile'));
     $form->getElement('sameSexPhotoView')->setValue(OW::getConfig()->getValue('selectgender', 'sameSexPhotoView'));
     $form->getElement('oppositeSexPhotoView')->setValue(OW::getConfig()->getValue('selectgender', 'oppositeSexPhotoView'));
     $form->getElement('opositeMatchSexJoin')->setValue(OW::getConfig()->getValue('selectgender', 'opositeMatchSexJoin'));
     $form->getElement('sameMatchSexJoin')->setValue(OW::getConfig()->getValue('selectgender', 'sameMatchSexJoin'));
     $form->getElement('opositeMatchSexSearch')->setValue(OW::getConfig()->getValue('selectgender', 'opositeMatchSexSearch'));
     $form->getElement('sameMatchSexSearch')->setValue(OW::getConfig()->getValue('selectgender', 'sameMatchSexSearch'));
     $form->getElement('guestRedirectToJoin')->setValue(OW::getConfig()->getValue('selectgender', 'guestRedirectToJoin'));
     if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
         $values = $form->getValues();
         OW::getConfig()->saveConfig('selectgender', 'disMaleToMaleProfile', $values['disMaleToMaleProfile']);
         OW::getConfig()->saveConfig('selectgender', 'disMaleToFemaleProfile', $values['disMaleToFemaleProfile']);
         OW::getConfig()->saveConfig('selectgender', 'disFemaleToFemaleProfile', $values['disFemaleToFemaleProfile']);
         OW::getConfig()->saveConfig('selectgender', 'sameSexPhotoView', $values['sameSexPhotoView']);
         OW::getConfig()->saveConfig('selectgender', 'oppositeSexPhotoView', $values['oppositeSexPhotoView']);
         OW::getConfig()->saveConfig('selectgender', 'opositeMatchSexJoin', $values['opositeMatchSexJoin']);
         OW::getConfig()->saveConfig('selectgender', 'sameMatchSexJoin', $values['sameMatchSexJoin']);
         OW::getConfig()->saveConfig('selectgender', 'opositeMatchSexSearch', $values['opositeMatchSexSearch']);
         OW::getConfig()->saveConfig('selectgender', 'sameMatchSexSearch', $values['sameMatchSexSearch']);
         OW::getConfig()->saveConfig('selectgender', 'guestRedirectToJoin', $values['guestRedirectToJoin']);
         OW::getFeedback()->info($language->text('selectgender', 'settings_updated'));
         $this->redirect();
     }
     $this->setPageHeading(OW::getLanguage()->text('selectgender', 'config_page_heading'));
     $isSkadate = OW::getPluginManager()->isPluginActive('skadate');
     $this->assign('isSkadate', $isSkadate);
 }
Example #3
0
 public function index($params)
 {
     if (OW::getRequest()->isAjax()) {
         exit;
     }
     $language = OW::getLanguage();
     $this->setPageHeading($language->text('base', 'massmailing_unsubscribe'));
     $code = null;
     $userId = null;
     $result = false;
     if (isset($params['code']) && isset($params['id'])) {
         $result = 'confirm';
         if (!empty($_POST['cancel'])) {
             $this->redirect(OW_URL_HOME);
         }
         $code = trim($params['code']);
         $userId = $params['id'];
         $user = $this->userServise->findUserById($userId);
         if ($user !== null) {
             if (md5($user->username . $user->password) === $code) {
                 $result = 'confirm';
                 if (!empty($_POST['confirm'])) {
                     BOL_PreferenceService::getInstance()->savePreferenceValue('mass_mailing_subscribe', false, $user->id);
                     $result = true;
                     OW::getFeedback()->info($language->text('base', 'massmailing_unsubscribe_successful'));
                     $this->redirect(OW_URL_HOME);
                 }
             }
         }
     }
     $this->assign('result', $result);
 }
Example #4
0
 /**
  * Default action
  */
 public function index()
 {
     $language = OW::getLanguage();
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('video', 'admin_menu_general'));
     $item->setUrl(OW::getRouter()->urlForRoute('video_admin_config'));
     $item->setKey('general');
     $item->setIconClass('ow_ic_gear_wheel');
     $menu = new BASE_CMP_ContentMenu(array($item));
     $this->addComponent('menu', $menu);
     $configs = OW::getConfig()->getValues('video');
     $configSaveForm = new ConfigSaveForm();
     $this->addForm($configSaveForm);
     if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
         $configSaveForm->process();
         OW::getFeedback()->info($language->text('video', 'settings_updated'));
         $this->redirect(OW::getRouter()->urlForRoute('video_admin_config'));
     }
     if (!OW::getRequest()->isAjax()) {
         $this->setPageHeading(OW::getLanguage()->text('video', 'admin_config'));
         $this->setPageHeadingIconClass('ow_ic_video');
         $menu->getElement('general')->setActive(true);
     }
     $configSaveForm->getElement('playerWidth')->setValue($configs['player_width']);
     $configSaveForm->getElement('playerHeight')->setValue($configs['player_height']);
     $configSaveForm->getElement('perPage')->setValue($configs['videos_per_page']);
     $configSaveForm->getElement('quota')->setValue($configs['user_quota']);
 }
Example #5
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct();
     if (!OW::getUser()->isAuthenticated()) {
         throw new AuthenticateException();
     }
     $this->avatarService = BOL_AvatarService::getInstance();
     $this->ajaxResponder = OW::getRouter()->urlFor('BASE_CTRL_Avatar', 'ajaxResponder');
     $avatarUploadForm = new avatarUploadForm();
     $this->addForm($avatarUploadForm);
     $language = OW::getLanguage();
     if (OW::getRequest()->isPost() && !OW::getRequest()->isAjax()) {
         $res = $avatarUploadForm->process();
         if ($res['result']) {
             $this->redirect();
         } else {
             if (isset($res['error']) && $res['error'] == -1) {
                 OW::getFeedback()->warning($language->text('base', 'not_valid_image'));
             } else {
                 OW::getFeedback()->warning($language->text('base', 'avatar_select_image'));
             }
         }
     }
     if (!OW::getRequest()->isAjax()) {
         OW::getDocument()->setHeading($language->text('base', 'avatar_change_avatar'));
         OW::getDocument()->setHeadingIconClass('ow_ic_picture');
     }
 }
Example #6
0
 /**
  * Default action
  */
 public function index()
 {
     $language = OW::getLanguage();
     $configSaveForm = new ConfigSaveForm();
     $this->addForm($configSaveForm);
     $activeModes = MAILBOX_BOL_ConversationService::getInstance()->getActiveModeList();
     if (count($activeModes) > 1) {
         $selectedMode = 'mailchat';
     } else {
         $selectedMode = $activeModes[0];
     }
     $this->assign('selectedMode', $selectedMode);
     $mailModeEnabled = in_array('mail', $activeModes);
     $this->assign('mailModeEnabled', $mailModeEnabled);
     if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
         $configSaveForm->process();
         // clear cache
         MAILBOX_BOL_ConversationService::getInstance()->resetAllUsersLastData();
         OW::getFeedback()->info($language->text('mailbox', 'settings_updated'));
         $this->redirect();
     }
     if (!OW::getRequest()->isAjax()) {
         $this->setPageHeading(OW::getLanguage()->text('mailbox', 'admin_config'));
         $this->setPageHeadingIconClass('ow_ic_mail');
     }
 }
Example #7
0
 public function index()
 {
     $language = OW::getLanguage();
     $this->setPageHeading($language->text('ynsocialpublisher', 'admin_config'));
     $this->setPageHeadingIconClass('ow_ic_picture');
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('ynsocialpublisher', 'admin_menu_general'));
     $item->setUrl(OW::getRouter()->urlForRoute('ynsocialpublisher.admin'));
     $item->setKey('general');
     $item->setIconClass('ow_ic_gear_wheel');
     $item->setOrder(0);
     $item->setActive(true);
     $menu = new BASE_CMP_ContentMenu(array($item));
     $this->addComponent('menu', $menu);
     $service = YNSOCIALPUBLISHER_BOL_Service::getInstance();
     $plugins = $service->getEnabledPlugins();
     $this->assign('plugins', $plugins);
     $form_url = OW::getRouter()->urlForRoute('ynsocialpublisher.admin');
     $this->assign('form_url', $form_url);
     if (OW::getRequest()->isPost()) {
         // get plugins data from post
         $params = $_POST['params'];
         foreach ($params as $key => $settings) {
             if (!isset($settings['providers'])) {
                 $settings['providers'] = array();
             }
             OW::getConfig()->saveConfig('ynsocialpublisher', $key, json_encode($settings));
         }
         OW::getFeedback()->info($language->text('ynsocialpublisher', 'settings_updated'));
         $this->redirect($form_url);
     }
 }
Example #8
0
 public function index()
 {
     $billingService = BOL_BillingService::getInstance();
     $gwKey = OCSBILLINGMONEYBOOKERS_CLASS_MoneybookersAdapter::GATEWAY_KEY;
     $language = OW::getLanguage();
     $form = new MoneybookersConfigForm();
     $this->addForm($form);
     if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
         $values = $form->getValues();
         $billingService->setGatewayConfigValue($gwKey, 'merchantId', $values['merchantId']);
         $billingService->setGatewayConfigValue($gwKey, 'merchantEmail', $values['merchantEmail']);
         $billingService->setGatewayConfigValue($gwKey, 'secret', $values['secret']);
         $billingService->setGatewayConfigValue($gwKey, 'sandboxMode', $values['sandboxMode']);
         $billingService->setGatewayConfigValue($gwKey, 'recipientDescription', $values['recipientDescription']);
         $billingService->setGatewayConfigValue($gwKey, 'language', $values['language']);
         OW::getFeedback()->info($language->text('ocsbillingmoneybookers', 'settings_updated'));
         $this->redirect();
     }
     $adapter = new OCSBILLINGMONEYBOOKERS_CLASS_MoneybookersAdapter();
     $this->assign('logoUrl', $adapter->getLogoUrl());
     $gateway = $billingService->findGatewayByKey($gwKey);
     $this->assign('gateway', $gateway);
     $this->assign('activeCurrency', $billingService->getActiveCurrency());
     $supported = $billingService->currencyIsSupported($gateway->currencies);
     $this->assign('currSupported', $supported);
     $logo = OW::getPluginManager()->getPlugin('ocsbillingmoneybookers')->getStaticUrl() . 'img/oxwallcandystore-logo.jpg';
     $this->assign('logo', $logo);
     $this->setPageHeading(OW::getLanguage()->text('ocsbillingmoneybookers', 'config_page_heading'));
     $this->setPageHeadingIconClass('ow_ic_app');
 }
Example #9
0
 /**
  * Default action
  */
 public function index()
 {
     $language = OW::getLanguage();
     $clipService = VIDEO_BOL_ClipService::getInstance();
     $userId = OW::getUser()->getId();
     if (!OW::getUser()->isAuthorized('video', 'add')) {
         $status = BOL_AuthorizationService::getInstance()->getActionStatus('video', 'add');
         throw new AuthorizationException($status['msg']);
     }
     if (!($clipService->findUserClipsCount($userId) <= $clipService->getUserQuotaConfig())) {
         $this->assign('auth_msg', $language->text('video', 'quota_exceeded', array('limit' => $clipService->getUserQuotaConfig())));
     } else {
         $this->assign('auth_msg', null);
         $videoAddForm = new videoAddForm();
         $this->addForm($videoAddForm);
         if (OW::getRequest()->isPost() && $videoAddForm->isValid($_POST)) {
             $values = $videoAddForm->getValues();
             $code = $clipService->validateClipCode($values['code']);
             if (!mb_strlen($code)) {
                 OW::getFeedback()->warning($language->text('video', 'resource_not_allowed'));
                 $this->redirect();
             }
             $res = $videoAddForm->process();
             OW::getFeedback()->info($language->text('video', 'clip_added'));
             $this->redirect(OW::getRouter()->urlForRoute('view_clip', array('id' => $res['id'])));
         }
     }
     if (!OW::getRequest()->isAjax()) {
         OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'video', 'video');
     }
     OW::getDocument()->setHeading($language->text('video', 'page_title_add_video'));
     OW::getDocument()->setHeadingIconClass('ow_ic_video');
     OW::getDocument()->setTitle($language->text('video', 'meta_title_video_add'));
     OW::getDocument()->setDescription($language->text('video', 'meta_description_video_add'));
 }
Example #10
0
 /**
  * Default action
  */
 public function index()
 {
     $language = OW::getLanguage();
     $uploadMaxFilesize = (double) ini_get("upload_max_filesize");
     $postMaxSize = (double) ini_get("post_max_size");
     $maxUploadMaxFilesize = $uploadMaxFilesize >= $postMaxSize ? $postMaxSize : $uploadMaxFilesize;
     $this->assign('maxUploadMaxFilesize', $maxUploadMaxFilesize);
     $configSaveForm = new ConfigSaveForm($maxUploadMaxFilesize);
     $this->addForm($configSaveForm);
     if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
         $configSaveForm->process();
         OW::getFeedback()->info($language->text('mailbox', 'settings_updated'));
         $this->redirect();
     }
     if (!OW::getRequest()->isAjax()) {
         $this->setPageHeading(OW::getLanguage()->text('mailbox', 'admin_config'));
         $this->setPageHeadingIconClass('ow_ic_mail');
     }
     /* OW::getDocument()->addOnloadScript("
        $(\"form[name='configSaveForm'] input[name='enableAttachments']\").change(
            function()
            {
                if( $(this).attr('checked') )
                {
                    $(\"form[name='configSaveForm'] input[name='uploadMaxFileSize']\").removeAttr('disabled');
                }
                else
                {
                    $(\"form[name='configSaveForm'] input[name='uploadMaxFileSize']\").attr('disabled','disabled');
                }
            });
        "); */
 }
Example #11
0
 public function index($params)
 {
     $id = (int) $params['id'];
     $menu = BOL_NavigationService::getInstance()->findMenuItemById($id);
     $form = new EditPluginPageForm('edit-form', $menu);
     $service = BOL_NavigationService::getInstance();
     if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
         $data = $form->getValues();
         $visibleFor = 0;
         $arr = !empty($data['visible-for']) ? $data['visible-for'] : array();
         foreach ($arr as $val) {
             $visibleFor += $val;
         }
         $service->saveMenuItem($menu->setVisibleFor($visibleFor));
         $languageService = BOL_LanguageService::getInstance();
         $langKey = $languageService->findKey($menu->getPrefix(), $menu->getKey());
         $langValue = $languageService->findValue($languageService->getCurrent()->getId(), $langKey->getId());
         $languageService->saveValue($langValue->setValue($data['name']));
         $adminPlugin = OW::getPluginManager()->getPlugin('admin');
         OW::getFeedback()->info(OW::getLanguage()->text($adminPlugin->getKey(), 'updated_msg'));
         $this->redirect();
     }
     //--
     $this->addForm($form);
 }
Example #12
0
 public function index($params = array())
 {
     $userService = BOL_UserService::getInstance();
     $language = OW::getLanguage();
     $this->setPageHeading($language->text('hotlist', 'admin_heading_settings'));
     $this->setPageHeadingIconClass('ow_ic_gear_wheel');
     $settingsForm = new Form('settingsForm');
     $settingsForm->setId('settingsForm');
     $expiration_time = new TextField('expiration_time');
     $expiration_time->setRequired();
     $expiration_time->setLabel($language->text('hotlist', 'label_expiration_time'));
     $expiration_time_value = (int) OW::getConfig()->getValue('hotlist', 'expiration_time') / 86400;
     $expiration_time->setValue($expiration_time_value);
     $settingsForm->addElement($expiration_time);
     $submit = new Submit('save');
     $submit->addAttribute('class', 'ow_ic_save');
     $submit->setValue($language->text('hotlist', 'label_save_btn_label'));
     $settingsForm->addElement($submit);
     $this->addForm($settingsForm);
     if (OW::getRequest()->isPost()) {
         if ($settingsForm->isValid($_POST)) {
             $data = $settingsForm->getValues();
             OW::getConfig()->saveConfig('hotlist', 'expiration_time', $data['expiration_time'] * 86400);
             OW::getFeedback()->info($language->text('hotlist', 'settings_saved'));
             $this->redirect();
         }
     }
 }
Example #13
0
 public function index()
 {
     $groups = MODERATION_BOL_Service::getInstance()->getContentGroups();
     if (OW::getRequest()->isPost()) {
         $selectedGroups = empty($_POST["groups"]) ? array() : $_POST["groups"];
         $types = array();
         foreach ($groups as $group) {
             $selected = in_array($group["name"], $selectedGroups);
             foreach ($group["entityTypes"] as $type) {
                 $types[$type] = $selected;
             }
         }
         OW::getConfig()->saveConfig("moderation", "content_types", json_encode($types));
         OW::getFeedback()->info(OW::getLanguage()->text("moderation", "content_types_saved_message"));
         $this->redirect(OW::getRouter()->urlForRoute("moderation.admin"));
     }
     $this->setPageHeading(OW::getLanguage()->text("moderation", "admin_heading"));
     $this->setPageTitle(OW::getLanguage()->text("moderation", "admin_title"));
     $form = new Form("contentTypes");
     $submit = new Submit("save");
     $submit->setLabel(OW::getLanguage()->text("admin", "save_btn_label"));
     $form->addElement($submit);
     $this->addForm($form);
     $this->assign("groups", $groups);
 }
Example #14
0
 public function index()
 {
     $language = OW::getLanguage();
     OW::getDocument()->setHeading($language->text('mcompose', 'heading_configuration'));
     OW::getDocument()->setHeadingIconClass('ow_ic_gear_wheel');
     $this->assign('pluginUrl', 'http://www.oxwall.org/store/item/10');
     if (!$this->plugin->isAvaliable()) {
         $this->assign('avaliable', false);
         return;
     }
     $this->assign('avaliable', true);
     $settingUrl = OW::getRouter()->urlForRoute('mailbox_admin_config');
     $this->assign('settingsUrl', $settingUrl);
     $configs = OW::getConfig()->getValues('mcompose');
     $features = array();
     $features["friends"] = MCOMPOSE_CLASS_FriendsBridge::getInstance()->isActive();
     $features["groups"] = MCOMPOSE_CLASS_GroupsBridge::getInstance()->isActive();
     $features["events"] = MCOMPOSE_CLASS_EventsBridge::getInstance()->isActive();
     $form = new MCOMPOSE_ConfigForm($configs, $features);
     $this->addForm($form);
     $this->assign("configs", $configs);
     $this->assign("features", $features);
     $this->assign("activeFeatures", array_filter($features));
     if (OW::getRequest()->isPost() && $form->isValid($_POST)) {
         if ($form->process($_POST)) {
             OW::getFeedback()->info($language->text('mcompose', 'admin_settings_updated'));
             $this->redirect(OW::getRouter()->urlForRoute('mcompose-admin'));
         }
     }
 }
Example #15
0
 public function settings()
 {
     $adminForm = new Form('adminForm');
     $language = OW::getLanguage();
     $config = OW::getConfig();
     $element = new TextField('autoclick');
     $element->setRequired(true);
     $validator = new IntValidator(1);
     $validator->setErrorMessage($language->text('autoviewmore', 'admin_invalid_number_error'));
     $element->addValidator($validator);
     $element->setLabel($language->text('autoviewmore', 'admin_auto_click'));
     $element->setValue($config->getValue('autoviewmore', 'autoclick'));
     $adminForm->addElement($element);
     $element = new Submit('saveSettings');
     $element->setValue($language->text('autoviewmore', 'admin_save_settings'));
     $adminForm->addElement($element);
     if (OW::getRequest()->isPost()) {
         if ($adminForm->isValid($_POST)) {
             $values = $adminForm->getValues();
             $config = OW::getConfig();
             $config->saveConfig('autoviewmore', 'autoclick', $values['autoclick']);
             OW::getFeedback()->info($language->text('autoviewmore', 'user_save_success'));
         }
     }
     $this->addForm($adminForm);
 }
Example #16
0
 public function index()
 {
     $language = OW::getLanguage();
     $billingService = BOL_BillingService::getInstance();
     $adminForm = new Form('adminForm');
     $element = new TextField('creditValue');
     $element->setRequired(true);
     $element->setLabel($language->text('billingcredits', 'admin_usd_credit_value'));
     $element->setDescription($language->text('billingcredits', 'admin_usd_credit_value_desc'));
     $element->setValue($billingService->getGatewayConfigValue('billingcredits', 'creditValue'));
     $validator = new FloatValidator(0.1);
     $validator->setErrorMessage($language->text('billingcredits', 'invalid_numeric_format'));
     $element->addValidator($validator);
     $adminForm->addElement($element);
     $element = new Submit('saveSettings');
     $element->setValue($language->text('billingcredits', 'admin_save_settings'));
     $adminForm->addElement($element);
     if (OW::getRequest()->isPost()) {
         if ($adminForm->isValid($_POST)) {
             $values = $adminForm->getValues();
             $billingService->setGatewayConfigValue('billingcredits', 'creditValue', $values['creditValue']);
             OW::getFeedback()->info($language->text('billingcredits', 'user_save_success'));
         }
     }
     $this->addForm($adminForm);
     $this->setPageHeading(OW::getLanguage()->text('billingcredits', 'config_page_heading'));
     $this->setPageTitle(OW::getLanguage()->text('billingcredits', 'config_page_heading'));
     $this->setPageHeadingIconClass('ow_ic_app');
 }
Example #17
0
 public function index()
 {
     $language = OW::getLanguage();
     $config = OW::getConfig();
     OW::getDocument()->setHeading(OW::getLanguage()->text('admin', 'heading_mobile_settings'));
     OW::getDocument()->setHeadingIconClass('ow_ic_gear_wheel');
     $settingsForm = new Form('mobile_settings');
     $disableMobile = new CheckboxField('disable_mobile');
     $disableMobile->setLabel($language->text('admin', 'mobile_settings_mobile_context_disable_label'));
     $disableMobile->setDescription($language->text('admin', 'mobile_settings_mobile_context_disable_desc'));
     $settingsForm->addElement($disableMobile);
     $submit = new Submit('save');
     $submit->setValue($language->text('admin', 'save_btn_label'));
     $settingsForm->addElement($submit);
     $this->addForm($settingsForm);
     if (OW::getRequest()->isPost()) {
         if ($settingsForm->isValid($_POST)) {
             $data = $settingsForm->getValues();
             $config->saveConfig('base', 'disable_mobile_context', (bool) $data['disable_mobile']);
             OW::getFeedback()->info($language->text('admin', 'settings_submit_success_message'));
         } else {
             OW::getFeedback()->error('Error');
         }
         $this->redirect();
     }
     $disableMobile->setValue($config->getValue('base', 'disable_mobile_context'));
 }
Example #18
0
 public function customization()
 {
     $language = OW::getLanguage();
     $this->setPageHeading($language->text('newsfeed', 'admin_page_heading'));
     $this->setPageTitle($language->text('newsfeed', 'admin_page_title'));
     $this->setPageHeadingIconClass('ow_ic_comment');
     $types = NEWSFEED_BOL_CustomizationService::getInstance()->getActionTypes();
     $form = new NEWSFEED_CustomizationForm();
     $this->addForm($form);
     $processTypes = array();
     foreach ($types as $type) {
         $field = new CheckboxField($type['activity']);
         $field->setValue($type['active']);
         $form->addElement($field);
         $processTypes[] = $type['activity'];
     }
     if (OW::getRequest()->isPost()) {
         $result = $form->process($_POST, $processTypes);
         if ($result) {
             OW::getFeedback()->info($language->text('newsfeed', 'customization_changed'));
         } else {
             OW::getFeedback()->warning($language->text('newsfeed', 'customization_not_changed'));
         }
         $this->redirect();
     }
     $this->assign('types', $types);
     $this->addComponent('menu', $this->getMenu());
 }
Example #19
0
 /**
  * Default action
  */
 public function index()
 {
     $lang = OW::getLanguage();
     OW::getDocument()->setHeading($lang->text('ocssitestats', 'admin_page_heading'));
     OW::getDocument()->setHeadingIconClass('ow_ic_gear_wheel');
     $pluginManager = OW::getPluginManager();
     $pluginsActivated = array('total_users' => true, 'online_users' => true, 'new_users_today' => true, 'new_users_this_month' => true, 'photos' => $pluginManager->isPluginActive('photo'), 'videos' => $pluginManager->isPluginActive('video'), 'blogs' => $pluginManager->isPluginActive('blogs'), 'groups' => $pluginManager->isPluginActive('groups'), 'events' => $pluginManager->isPluginActive('event'), 'discussions' => $pluginManager->isPluginActive('forum'), 'links' => $pluginManager->isPluginActive('links'));
     $config = OW::getConfig();
     if (OW::getRequest()->isPost() && !empty($_POST['action'])) {
         switch ($_POST['action']) {
             case 'update_metrics':
                 $conf = array();
                 foreach ($pluginsActivated as $key => $m) {
                     $conf[$key] = $pluginsActivated[$key] && !empty($_POST['metrics'][$key]) && $_POST['metrics'][$key];
                 }
                 $config->saveConfig('ocssitestats', 'metrics', json_encode($conf));
                 OW::getFeedback()->info($lang->text('ocssitestats', 'settings_updated'));
                 $this->redirect();
                 break;
             case 'update_settings':
                 $config->saveConfig('ocssitestats', 'zero_values', !empty($_POST['zero_values']));
                 OW::getFeedback()->info($lang->text('ocssitestats', 'settings_updated'));
                 $this->redirect();
                 break;
         }
     }
     $metricsConf = json_decode($config->getValue('ocssitestats', 'metrics'), true);
     $this->assign('metrics', $metricsConf);
     $zeroValues = $config->getValue('ocssitestats', 'zero_values');
     $this->assign('zeroValues', $zeroValues);
     $this->assign('pluginsActivated', $pluginsActivated);
     $logo = OW::getPluginManager()->getPlugin('ocssitestats')->getStaticUrl() . 'img/oxwallcandystore-logo.jpg';
     $this->assign('logo', $logo);
 }
Example #20
0
 /**
  * List on blocked users
  *
  * @throws AuthenticateException
  */
 public function blocked()
 {
     $userId = OW::getUser()->getId();
     if (!OW::getUser()->isAuthenticated() || $userId === null) {
         throw new AuthenticateException();
     }
     // unblock action
     if (OW::getRequest()->isPost() && !empty($_POST['userId'])) {
         BOL_UserService::getInstance()->unblock($_POST['userId']);
         // reload the current page
         OW::getFeedback()->info(OW::getLanguage()->text('base', 'user_feedback_profile_unblocked'));
         $this->redirect();
     }
     // process pagination params
     $page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1;
     $perPage = $this->usersPerPage;
     $first = ($page - 1) * $perPage;
     $count = $perPage;
     $service = BOL_UserService::getInstance();
     $listCount = $service->countBlockedUsers($userId);
     $blockedList = $listCount ? $service->findBlockedUserList($userId, $first, $count) : array();
     $listCmp = new BASE_CMP_BlockedUserList(BOL_UserService::getInstance()->findUserListByIdList($blockedList), $listCount, $perPage);
     // init components
     $this->addComponent('listCmp', $listCmp);
     // set page settings
     $this->setPageHeading(OW::getLanguage()->text('base', 'blocked_users_browse_page_heading'));
     $this->setPageTitle(OW::getLanguage()->text('base', 'blocked_users_browse_page_heading'));
 }
Example #21
0
 /**
  * Default action
  */
 public function index()
 {
     $language = OW::getLanguage();
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('vwls', 'admin_menu_general'));
     $item->setUrl(OW::getRouter()->urlForRoute('vwls_admin_config'));
     $item->setKey('general');
     $item->setIconClass('ow_ic_gear_wheel');
     $menu = new BASE_CMP_ContentMenu(array($item));
     $this->addComponent('menu', $menu);
     $configs = OW::getConfig()->getValues('vwls');
     $configSaveForm = new ConfigSaveForm();
     $this->addForm($configSaveForm);
     if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
         $res = $configSaveForm->process();
         OW::getFeedback()->info($language->text('vwls', 'settings_updated'));
         $this->redirect(OW::getRouter()->urlForRoute('vwls_admin_config'));
     }
     if (!OW::getRequest()->isAjax()) {
         $this->setPageHeading(OW::getLanguage()->text('vwls', 'admin_config'));
         $this->setPageHeadingIconClass('ow_ic_vwls');
         $menu->getElement('general')->setActive(true);
     }
     $configSaveForm->getElement('server')->setValue($configs['server']);
     $configSaveForm->getElement('serverAMF')->setValue($configs['serverAMF']);
     $configSaveForm->getElement('serverRTMFP')->setValue($configs['serverRTMFP']);
     $configSaveForm->getElement('enableRTMP')->setValue($configs['enableRTMP']);
     $configSaveForm->getElement('enableP2P')->setValue($configs['enableP2P']);
     $configSaveForm->getElement('supportRTMP')->setValue($configs['supportRTMP']);
     $configSaveForm->getElement('supportP2P')->setValue($configs['supportP2P']);
     $configSaveForm->getElement('alwaysRTMP')->setValue($configs['alwaysRTMP']);
     $configSaveForm->getElement('alwaysP2P')->setValue($configs['alwaysP2P']);
     $configSaveForm->getElement('videoCodec')->setValue($configs['videoCodec']);
     $configSaveForm->getElement('codecProfile')->setValue($configs['codecProfile']);
     $configSaveForm->getElement('codecLevel')->setValue($configs['codecLevel']);
     $configSaveForm->getElement('soundCodec')->setValue($configs['soundCodec']);
     $configSaveForm->getElement('p2pGroup')->setValue($configs['p2pGroup']);
     $configSaveForm->getElement('tokenKey')->setValue($configs['tokenKey']);
     $configSaveForm->getElement('snapshotsTime')->setValue($configs['snapshotsTime']);
     $configSaveForm->getElement('camMaxBandwidth')->setValue($configs['camMaxBandwidth']);
     $configSaveForm->getElement('bufferLive')->setValue($configs['bufferLive']);
     $configSaveForm->getElement('bufferFull')->setValue($configs['bufferFull']);
     $configSaveForm->getElement('bufferLive2')->setValue($configs['bufferLive2']);
     $configSaveForm->getElement('bufferFull2')->setValue($configs['bufferFull2']);
     $configSaveForm->getElement('disableBandwidthDetection')->setValue($configs['disableBandwidthDetection']);
     $configSaveForm->getElement('limitByBandwidth')->setValue($configs['limitByBandwidth']);
     $configSaveForm->getElement('generateSnapshots')->setValue($configs['generateSnapshots']);
     $configSaveForm->getElement('externalInterval')->setValue($configs['externalInterval']);
     $configSaveForm->getElement('externalInterval2')->setValue($configs['externalInterval2']);
     $configSaveForm->getElement('ws_ads')->setValue($configs['ws_ads']);
     $configSaveForm->getElement('adsTimeout')->setValue($configs['adsTimeout']);
     $configSaveForm->getElement('adsInterval')->setValue($configs['adsInterval']);
     $configSaveForm->getElement('statusInterval')->setValue($configs['statusInterval']);
     $configSaveForm->getElement('availability')->setValue($configs['availability']);
     $configSaveForm->getElement('status')->setValue($configs['status']);
     $configSaveForm->getElement('member')->setValue($configs['member']);
     $configSaveForm->getElement('member_list')->setValue($configs['member_list']);
     $configSaveForm->getElement('baseSwf_url')->setValue($configs['baseSwf_url']);
 }
Example #22
0
 public function delete()
 {
     $restrictedUsernamesService = BOL_RestrictedUsernamesDao::getInstance();
     $restrictedUsernamesService->deleteRestrictedUsername($_GET['username']);
     $language = OW::getLanguage();
     OW::getFeedback()->info($language->text('admin', 'restrictedusernames_username_deleted'));
     $this->redirect('admin/restricted-usernames');
 }
Example #23
0
 public function delete($params)
 {
     if (!(OW::getUser()->isAdmin() || BOL_AuthorizationService::getInstance()->isModerator())) {
         exit;
     }
     BOL_FlagService::getInstance()->deleteById($params['id']);
     OW::getFeedback()->info(OW::getLanguage()->text('base', 'flags_deleted'));
     $this->redirect($_SERVER['HTTP_REFERER']);
 }
Example #24
0
 protected function getFtpConnection()
 {
     try {
         $ftp = $this->storageService->getFtpConnection();
     } catch (LogicException $e) {
         OW::getFeedback()->error($e->getMessage());
         $this->redirect(OW::getRequest()->buildUrlQueryString(OW::getRouter()->urlFor("ADMIN_CTRL_Storage", "ftpAttrs"), array(BOL_StorageService::URI_VAR_BACK_URI => urlencode(OW::getRequest()->getRequestUri()))));
     }
     return $ftp;
 }
Example #25
0
 public function unsuspend($params)
 {
     if (!OW::getUser()->isAuthorized('base') || empty($params['id'])) {
         exit;
     }
     $id = (int) $params['id'];
     $userService = BOL_UserService::getInstance();
     $userService->unsuspend($id);
     OW::getFeedback()->info(OW::getLanguage()->text('base', 'user_feedback_profile_unsuspended'));
     $this->redirect($_GET['backUrl']);
 }
Example #26
0
 /**
  * Default action
  */
 public function index()
 {
     $form = new SettingsForm($this);
     if (!empty($_POST) && $form->isValid($_POST)) {
         $data = $form->getValues();
         OW::getConfig()->saveConfig('links', 'results_per_page', $data['results_per_page']);
         OW::getConfig()->saveConfig('links', 'result_mode', $data['mode']);
         OW::getFeedback()->info(OW::getLanguage()->text('links', 'updated'));
         $this->redirect(OW::getRouter()->getBaseUrl() . OW::getRouter()->getUri());
     }
     $this->addForm($form);
 }
Example #27
0
 public function updateActive()
 {
     //	process
     ////	inactive all services
     YNSOCIALCONNECT_BOL_ServicesService::getInstance()->updateActiveStatusAllServices('0');
     foreach ($_POST['provider'] as $id) {
         YNSOCIALCONNECT_BOL_ServicesService::getInstance()->updateActiveById($id, '1');
     }
     // 	end
     OW::getFeedback()->info(OW::getLanguage()->text('ynsocialconnect', 'txt_update_successfully'));
     $this->redirect(OW::getRouter()->urlFor('YNSOCIALCONNECT_CTRL_Admin', 'manageProviders'));
 }
Example #28
0
 /**
  * Method called just before request responding.
  */
 public function finalize()
 {
     $document = OW::getDocument();
     $meassages = OW::getFeedback()->getFeedback();
     foreach ($meassages as $messageType => $messageList) {
         foreach ($messageList as $message) {
             $document->addOnloadScript("OWM.message(" . json_encode($message) . ", '" . $messageType . "');");
         }
     }
     $event = new OW_Event(OW_EventManager::ON_FINALIZE);
     OW::getEventManager()->trigger($event);
 }
Example #29
0
 /**
  * Default action
  */
 public function index()
 {
     $language = OW::getLanguage();
     $item = new BASE_MenuItem();
     $item->setLabel($language->text('vwvr', 'admin_menu_general'));
     $item->setUrl(OW::getRouter()->urlForRoute('vwvr_admin_config'));
     $item->setKey('general');
     $item->setIconClass('ow_ic_gear_wheel');
     $menu = new BASE_CMP_ContentMenu(array($item));
     $this->addComponent('menu', $menu);
     $configs = OW::getConfig()->getValues('vwvr');
     $configSaveForm = new ConfigSaveForm();
     $this->addForm($configSaveForm);
     if (OW::getRequest()->isPost() && $configSaveForm->isValid($_POST)) {
         $res = $configSaveForm->process();
         OW::getFeedback()->info($language->text('vwvr', 'settings_updated'));
         $this->redirect(OW::getRouter()->urlForRoute('vwvr_admin_config'));
     }
     if (!OW::getRequest()->isAjax()) {
         $this->setPageHeading(OW::getLanguage()->text('vwvr', 'admin_config'));
         $this->setPageHeadingIconClass('ow_ic_vwvr');
         $menu->getElement('general')->setActive(true);
     }
     $configSaveForm->getElement('server')->setValue($configs['server']);
     $configSaveForm->getElement('serverAMF')->setValue($configs['serverAMF']);
     $configSaveForm->getElement('videoCodec')->setValue($configs['videoCodec']);
     $configSaveForm->getElement('codecProfile')->setValue($configs['codecProfile']);
     $configSaveForm->getElement('codecLevel')->setValue($configs['codecLevel']);
     $configSaveForm->getElement('soundCodec')->setValue($configs['soundCodec']);
     $configSaveForm->getElement('soundQuality')->setValue($configs['soundQuality']);
     // $configSaveForm->getElement('microphone_rate')->setValue($configs['micRate']);
     $configSaveForm->getElement('bufferLive')->setValue($configs['bufferLive']);
     $configSaveForm->getElement('camMaxBandwidth')->setValue($configs['camMaxBandwidth']);
     $configSaveForm->getElement('bufferLive')->setValue($configs['bufferLive']);
     $configSaveForm->getElement('bufferFull')->setValue($configs['bufferFull']);
     $configSaveForm->getElement('bufferLivePlayback')->setValue($configs['bufferLivePlayback']);
     $configSaveForm->getElement('bufferFullPlayback')->setValue($configs['bufferFullPlayback']);
     $configSaveForm->getElement('availability')->setValue($configs['availability']);
     $configSaveForm->getElement('status')->setValue($configs['status']);
     $configSaveForm->getElement('member')->setValue($configs['member']);
     $configSaveForm->getElement('member_list')->setValue($configs['member_list']);
     $configSaveForm->getElement('baseSwf_url')->setValue($configs['baseSwf_url']);
     $configSaveForm->getElement('record_path')->setValue($configs['recordPath']);
     $configSaveForm->getElement('record_limit')->setValue($configs['recordLimit']);
     $configSaveForm->getElement('resolution')->setValue($configs['camWidth'] . "x" . $configs['camHeight']);
     $configSaveForm->getElement('camera_fps')->setValue($configs['camFPS']);
     $configSaveForm->getElement('microphone_rate')->setValue($configs['micRate']);
     $configSaveForm->getElement('bandwidth')->setValue($configs['camBandwidth']);
     $configSaveForm->getElement('layout_code')->setValue($configs['layoutCode']);
     $configSaveForm->getElement('show_camera_settings')->setValue($configs['showCamSettings']);
     $configSaveForm->getElement('advanced_camera_settings')->setValue($configs['advancedCamSettings']);
     $configSaveForm->getElement('fill_window')->setValue($configs['fillWindow']);
 }
Example #30
0
 public function saveSettings()
 {
     $source = $_POST["source"] == "all" ? "all" : "album";
     $album = $_POST["album"];
     $userId = $_POST["userId"];
     if ($userId != OW::getUser()->getId() && !OW::getUser()->isAuthorized("pcgallery")) {
         throw new Redirect403Exception();
     }
     BOL_PreferenceService::getInstance()->savePreferenceValue("pcgallery_album", $album, $userId);
     BOL_PreferenceService::getInstance()->savePreferenceValue("pcgallery_source", $source, $userId);
     OW::getFeedback()->info(OW::getLanguage()->text("pcgallery", "settings_saved_message"));
     $this->redirect(BOL_UserService::getInstance()->getUserUrl($userId));
 }