Example #1
0
 public function display()
 {
     // Only admin can use this function to invite guests
     $jxConfig = new JXConfig();
     $my = JXFactory::getUser();
     $mainframe = JFactory::getApplication();
     $accessHelper = new AccountAccessHelper();
     if (!$my->authorise('stream.setting.edit', $accessHelper)) {
         $mainframe->redirect(JURI::base(), JText::_('COM_ACCOUNT_ERRMSG_INVITATION_DENIED'), 'error');
     }
     if ($_POST) {
         jimport('joomla.utilities.xintegration');
         // Check if there is ad_integration posted and if the value is activedirectory
         // by comparing with xintegration library for supported integrations
         $adIntegration = JRequest::getString('ad_integration', '');
         if (!empty($adIntegration) && JXIntegration::isActiveDirectory($adIntegration)) {
             $integrationTbl = JTable::getInstance('integration', 'AccountTable');
             $integrationTbl->load(array('name' => $adIntegration));
             $integrationTbl->setParam('dc', JRequest::getString('ad_dc', ''));
             $integrationTbl->setParam('dm', JRequest::getString('ad_dm', ''));
             if (JRequest::getString('ad_pw', '') != '') {
                 $integrationTbl->setParam('pw', JRequest::getString('ad_pw', ''));
             }
             $integrationTbl->setParam('un', JRequest::getString('ad_un', ''));
             $integrationTbl->setParam('hi', JRequest::getString('ad_hi', ''));
             if (!$integrationTbl->store()) {
                 $mainframe->redirect(JRoute::_('index.php?option=com_account&view=integration'), $integrationTbl->getError(), 'error');
             }
             $mainframe->redirect(JRoute::_('index.php?option=com_account&view=integration'), JText::_('COM_ACCOUNT_ACTION_SAVE_INTEGRATION_SUCCESS!'));
         }
     }
     parent::display();
 }
Example #2
0
 function display($tpl = null)
 {
     $user = JXFactory::getUser();
     $this->assignRef('user', $user);
     // use JForm to create standardize
     $form = JForm::getInstance('profileForm', JPATH_ROOT . DS . 'components' . DS . 'com_profile' . DS . 'models' . DS . 'forms' . DS . 'edit.xml');
     $this->assignRef('profileForm', $form);
     $this->assign('userEmail', $user->get('email'));
     $this->assign('userTimezone', $user->getParam('timezone'));
     $this->assign('userLanguage', $user->getParam('language'));
     $this->assign('userAboutMe', $user->getParam('about_me'));
     $this->assign('isIntegration', JXIntegration::isActiveDirectory($user->getParam('integration')));
     /* $this->assignRef('timezoneList', $this->getTimezoneList()); */
     /* /\* defaulted to +8 *\/ */
     /* $jLang = JFactory::getLanguage(); */
     /* $this->assignRef('languageList', $jLang->getKnownLanguages()); */
     $document = JFactory::getDocument();
     $document->addScript(JURI::root() . 'media/jquery/jquery-1.7.min.js');
     $document->setTitle(JText::_('COM_PROFILE_LABEL_EDIT_PROFILE'));
     parent::display($tpl);
 }
Example #3
0
 public function __construct()
 {
     $this->_name = 'activedirectory';
     return parent::__construct();
 }