</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
public function getProfileTypes() { static $types = false; if (!$types) { $path = JPATH_ROOT . '/components/com_community/libraries/fields/customfields.xml'; $parser = new SimpleXMLElement($path, NULL, true); $fields = $parser->fields; //to accomodate xipt component $xipt = CSystemHelper::isComponentExists('com_xipt') ? JComponentHelper::getComponent('com_xipt', true)->enabled : false; $filterField = array('Profiletypes', 'Templates'); foreach ($fields->children() as $field) { //if xipt component is not enabled, filter the field if (!$xipt && in_array($field->name, $filterField)) { continue; } $data[(string) $field->type] = $field->name; } $types = $data; } return $types; }
/** * remove friend */ public function removeFriend($friendid) { $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $model = CFactory::getModel('friends'); $my = CFactory::getUser(); $viewName = $jinput->get->get('view', ''); //JRequest::getVar('view','','GET'); if (CSystemHelper::communityViewExists($viewName)) { $view = CFactory::getView($viewName); } if ($model->deleteFriend($my->id, $friendid)) { // Substract the friend count $model->updateFriendCount($my->id); $model->updateFriendCount($friendid); //add user points // we deduct poinst to both parties //CFactory::load( 'libraries' , 'userpoints' ); CUserPoints::assignPoint('friends.remove'); CUserPoints::assignPoint('friends.remove', $friendid); $friend = CFactory::getUser($friendid); if (isset($view)) { $view->addInfo(JText::sprintf('COM_COMMUNITY_FRIENDS_REMOVED', $friend->getDisplayName())); } //@todo notify friend after remove them from our friend list //trigger for onFriendRemove $eventObject = new stdClass(); $eventObject->profileOwnerId = $my->id; $eventObject->friendId = $friendid; $this->_triggerFriendEvents('onFriendRemove', $eventObject); unset($eventObject); } else { if (isset($view)) { $view->addinfo(JText::_('COM_COMMUNITY_FRIENDS_REMOVING_FRIEND_ERROR')); } } }
public function ajaxAdagencyGetImpression($adsId, $campaignId, $bannerId, $type) { if (CSystemHelper::isComponentExists('com_adagency') && JComponentHelper::getComponent('com_adagency', true)->enabled) { jimport('joomla.application.component.model'); JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_adagency/models'); $agencyModel = JModelLegacy::getInstance('Adagencyadvertisement', 'AdagencyModel'); $agencyModel->increaseImpressions($adsId, $campaignId, $bannerId, $type); // call to increase impression die(json_encode(array('status' => true))); } }
if ($my->id != 0) { ?> <script> joms_infinitescroll = +'<?php echo $config->get("infinitescroll", 0); ?> '; joms_autoloadtrigger = +'<?php echo $config->get("autoloadtrigger", 100); ?> '; </script> <?php } ?> <?php } ?> <?php if ($my->id != 0 && !$isSingleActivity && CSystemHelper::isComponentExists('com_adagency') && JComponentHelper::getComponent('com_adagency', true)->enabled) { ?> <script>joms_adagency = 1;</script> <?php } ?> </div> <!-- end: .joms-stream__wrapper -->
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"); }
/** * 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'); }