public function attachHeaders() { $document = JFactory::getDocument(); $config = CFactory::getConfig(); $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $view = $jinput->request->get('view', ''); $my = CFactory::getUser(); $userid = $jinput->get('userid', '', 'INT'); $user = CFactory::getUser($userid); if ($document->getType() != 'html') { return; } // Mobile devices flag. $isMobile = preg_match('/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i', $_SERVER['HTTP_USER_AGENT']); $isIOS = preg_match('/iphone|ipad|ipod/i', $_SERVER['HTTP_USER_AGENT']); // Disable zooming on mobile devices. if ($isMobile) { $document->setMetaData('viewport', 'width=device-width, initial-scale=1, user-scalable=no'); } // Output view. $document->addScriptDeclaration("joms_page = '" . $view . "';"); // IDs. $document->addScriptDeclaration('joms_my_id = ' . $my->id . ';'); $document->addScriptDeclaration('joms_user_id = ' . $user->id . ';'); // Group's ID. if ($view === 'groups') { $groupid = $jinput->get('groupid', '', 'INT'); $group = JTable::getInstance('Group', 'CTable'); $group->load($groupid); $document->addScriptDeclaration("joms_group_id = +'" . $group->id . "';"); } // Event's ID. if ($view === 'events') { $eventid = $jinput->get('eventid', '', 'INT'); $event = JTable::getInstance('Event', 'CTable'); $event->load($eventid); $document->addScriptDeclaration("joms_event_id = +'" . $event->id . "';"); } // Two-factor authentication. $document->addScriptDeclaration('joms_use_tfa = ' . (CSystemHelper::tfaEnabled() ? 'true' : 'false') . ';'); // Flag to check if we should use native video player. if ($config->get('video_native') == 1) { $document->addScriptDeclaration('joms_videoplayer_native = 1;'); } CTemplate::addStylesheet('style'); $templateParams = CTemplate::getTemplateParams(); CTemplate::addStylesheet('style.' . $templateParams->get('colorTheme', 'green')); // Load rtl stylesheet if ($document->direction == 'rtl') { CTemplate::addStylesheet('style.rtl'); } // Datepicker style. $css = 'assets/pickadate/themes/' . ($isMobile ? 'default' : 'classic') . '.combined.css'; CFactory::attach($css, 'css'); // Fluid video on small screen. $css = '<style type="text/css">video { width: 100% !important; height: auto !important; }</style>'; $document->addCustomTag($css); //$document->addScript("http://192.168.1.19:8080/target/target-script-min.js#anonymous"); }
</div> <div class="joms-input--append"> <svg viewBox="0 0 16 16" class="joms-icon"> <use xlink:href="<?php echo CRoute::getURI(); ?> #joms-icon-lock"></use> </svg> <input class="joms-input" type="password" placeholder="<?php echo JText::_('COM_COMMUNITY_PASSWORD'); ?> " name="password" autocapitalize="off"> </div> <?php if (CSystemHelper::tfaEnabled()) { ?> <div class="joms-input--append"> <svg viewBox="0 0 16 16" class="joms-icon"> <use xlink:href="<?php echo CRoute::getURI(); ?> #joms-icon-key"></use> </svg> <input class="joms-input" type="text" placeholder="<?php echo JText::_('COM_COMMUNITY_AUTHENTICATION_KEY'); ?> " name="secretkey" autocapitalize="off"> </div> <?php
/** * Edits a user profile * * @access public * @param array An associative array to display the editing of the fields */ public function edit($data) { $mainframe = JFactory::getApplication(); // access check CFactory::setActiveProfile(); if (!$this->accessAllowed('registered')) { return; } $my = CFactory::getUser(); $config = CFactory::getConfig(); $userParams = $my->getParams(); $pathway = $mainframe->getPathway(); $menu = JFactory::getApplication()->getMenu()->getActive(); $pathway->addItem(JText::_($menu->title), CRoute::getExternalURL($menu->link)); $pathway->addItem(JText::_($my->getDisplayName()), CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id)); $pathway->addItem(JText::_('COM_COMMUNITY_PROFILE_EDIT'), ''); /** * Opengraph */ CHeadHelper::setType('website', JText::_('COM_COMMUNITY_PROFILE_EDIT')); $this->showSubmenu(); $jConfig = JFactory::getConfig(); $app = CAppPlugins::getInstance(); $appFields = $app->triggerEvent('onFormDisplay', array('jsform-profile-edit')); $beforeFormDisplay = CFormElement::renderElements($appFields, 'before'); $afterFormDisplay = CFormElement::renderElements($appFields, 'after'); $multiprofile = JTable::getInstance('MultiProfile', 'CTable'); $multiprofile->load($my->getProfileType()); $model = CFactory::getModel('Profile'); $profileTypes = $model->getProfileTypes(); // @rule: decide to show multiprofile or not. $showProfileType = $config->get('profile_multiprofile') && $profileTypes && count($profileTypes) >= 1 && !$multiprofile->profile_lock; $isAdmin = COwnerHelper::isCommunityAdmin(); $profileField = $data->profile['fields']; if (!is_null($profileField)) { foreach ($profileField as $key => $val) { foreach ($val as $pkey => $field) { if (!empty($field['options'])) { $i = 0; foreach ($field['options'] as $option) { $profileField[$key][$pkey]['options'][$i] = htmlspecialchars($option); $i++; } } if (!$isAdmin && $field['visible'] == 2) { unset($profileField[$key][$pkey]); } } } } $fbHtml = ''; $connectModel = CFactory::getModel('Connect'); $associated = $connectModel->isAssociated($my->id); if ($config->get('fbconnectkey') && $config->get('fbconnectsecret') && !$config->get('usejfbc')) { $facebook = new CFacebook(); $fbHtml = $facebook->getLoginHTML(); } if ($config->get('usejfbc')) { if (class_exists('JFBCFactory')) { $providers = JFBCFactory::getAllProviders(); foreach ($providers as $p) { $fbHtml .= $p->loginButton(); } } } $isUseFirstLastName = CUserHelper::isUseFirstLastName(); $data->profile['fields'] = $profileField; $tmpl = new CTemplate(); if (CSystemHelper::tfaEnabled()) { $tfaForm = $this->getTwofactorform(); $userModel = new UsersModelUser(); $otpConfig = $userModel->getOtpConfig(CFactory::getUser()->id); $tmpl->set('tfaForm', $tfaForm)->set('otpConfig', $otpConfig); } echo $tmpl->set('showProfileType', $showProfileType)->set('multiprofile', $multiprofile)->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->set('fields', $data->profile['fields'])->set('user', $my)->set('fbHtml', $fbHtml)->set('canEditUsername', JComponentHelper::getParams('com_users')->get('change_login_name'))->set('fbPostStatus', $userParams->get('postFacebookStatus'))->set('jConfig', $jConfig)->set('params', $data->params)->set('config', $config)->set('associated', $associated)->set('isAdmin', COwnerHelper::isCommunityAdmin())->set('offsetList', $data->offsetList)->set('isUseFirstLastName', $isUseFirstLastName)->set('submenu', $this->showSubmenu(false))->fetch('profile/edit'); }