示例#1
0
 function grabUsergroupInfo()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $user = JFactory::getUser();
     $ugid = $app->input->get('ugid', 0, 'int');
     //if the user has JoomBri profile, redirect him to the dashboard
     $hasJBProfile = JblanceHelper::hasJBProfile($user->id);
     if ($hasJBProfile) {
         $link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $this->setRedirect($link);
         return;
     }
     $session = JFactory::getSession();
     $session->set('ugid', $ugid, 'register');
     $session->clear('skipPlan', 'register');
     //clear or reset skip plan session if the registration is restarted.
     $freeMode = JblanceHelper::isFreeMode($ugid);
     if ($freeMode) {
         // if the user is not registered, direct him to registration page else to profile page.
         if ($user->id == 0) {
             $return = JRoute::_('index.php?option=com_jblance&view=guest&layout=register&step=3', false);
         } else {
             $return = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield', false);
         }
     } else {
         // check for skipping of plan selection for this usergroup. If skipped, set the default plan for the usergroup
         $userHelper = JblanceHelper::get('helper.user');
         $ugroup = $userHelper->getUserGroupInfo(null, $ugid);
         if ($ugroup->skipPlan) {
             $query = "SELECT id FROM #__jblance_plan WHERE default_plan=1 AND ug_id=" . $db->quote($ugid);
             $db->setQuery($query);
             $defaultPlanId = $db->loadResult();
             if (empty($defaultPlanId)) {
                 $app->enqueueMessage(JText::_('COM_JBLANCE_NO_DEFAULT_PLAN_FOR_THE_USERGROUP', 'error'));
                 $return = JRoute::_('index.php?option=com_jblance&view=guest&layout=showfront', false);
             } else {
                 $session->set('planid', $defaultPlanId, 'register');
                 $session->set('gateway', 'banktransfer', 'register');
                 $session->set('skipPlan', 1, 'register');
                 // if the user is not registered, direct him to registration page else to profile page.
                 if ($user->id == 0) {
                     $return = JRoute::_('index.php?option=com_jblance&view=guest&layout=register&step=2', false);
                 } else {
                     $return = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield&step=2', false);
                 }
             }
         } else {
             $return = JRoute::_('index.php?option=com_jblance&view=membership&layout=planadd&step=2', false);
         }
     }
     $this->setRedirect($return);
     return;
 }
示例#2
0
 function getShowFront()
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $db = JFactory::getDbo();
     //if the user has JoomBri profile, redirect him to the dashboard
     $hasJBProfile = JblanceHelper::hasJBProfile($user->id);
     if ($hasJBProfile) {
         $link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $app->redirect($link);
     }
     $query = 'SELECT * FROM #__jblance_usergroup ' . 'WHERE published=1 ' . 'ORDER BY ordering';
     $db->setQuery($query);
     $userGroups = $db->loadObjectList();
     $return[0] = $userGroups;
     return $return;
 }
示例#3
0
$model = $this->getModel();
$user = JFactory::getUser();
$uri = JFactory::getURI();
$config = JblanceHelper::getConfig();
$currencycode = $config->currencyCode;
$dformat = $config->dateFormat;
$enableReporting = $config->enableReporting;
$guestReporting = $config->enableGuestReporting;
$enableAddThis = $config->enableAddThis;
$addThisPubid = $config->addThisPubid;
$showUsername = $config->showUsername;
$sealProjectBids = $config->sealProjectBids;
$nameOrUsername = $showUsername ? 'username' : 'name';
$projHelper = JblanceHelper::get('helper.project');
// create an instance of the class ProjectHelper
$hasJBProfile = JblanceHelper::hasJBProfile($user->id);
$publisher = JFactory::getUser($row->publisher_userid);
if ($hasJBProfile) {
    $jbuser = JblanceHelper::get('helper.user');
    $userGroup = $jbuser->getUserGroupInfo($user->id, null);
}
$isMine = $row->publisher_userid == $user->id;
$link_report = JRoute::_('index.php?option=com_jblance&view=message&layout=report&id=' . $row->id . '&report=project&link=' . base64_encode($uri));
$link_edit_project = JRoute::_('index.php?option=com_jblance&view=project&layout=editproject&id=' . $row->id);
$link_pick_user = JRoute::_('index.php?option=com_jblance&view=project&layout=pickuser&id=' . $row->id);
JText::script('COM_JBLANCE_CLOSE');
$now = JFactory::getDate();
$expiredate = JFactory::getDate($row->start_date);
$expiredate->modify("+{$row->expires} days");
//$isExpired = ($now > $expiredate) ? true : false;
$isExpired = $row->status == 'COM_JBLANCE_EXPIRED' ? true : false;
示例#4
0
defined('_JEXEC') or die('Restricted access');
//JHtml::_('jquery.framework');
JHtml::_('behavior.modal', 'a.jb-modal');
//JHtml::_('behavior.tabstate');
$doc = JFactory::getDocument();
//$doc->addScript("components/com_jblance/js/utility.js");
$app = JFactory::getApplication();
$model = $this->getModel();
$user = JFactory::getUser();
$userid = $app->input->get('id', 0, 'int');
if (empty($userid)) {
    // get the current userid if not passed
    $userid = $user->id;
}
$isMine = $user->id == $userid;
$hasJBProfileForViewer = JblanceHelper::hasJBProfile($user->id);
//check if the profile viewer has JB profile
$jbuser = JblanceHelper::get('helper.user');
// create an instance of the class UserHelper
$userInfo = $jbuser->getUserGroupInfo($userid, null);
// this holds the info of profile owner
//if ($hasJBProfileForViewer)
//  $viewerInfo = $jbuser->getUserGroupInfo($user->id, null);  // this holds the info of profile viewer
if ($hasJBProfileForViewer) {
    $viewerInfo = $jbuser->getUserGroupInfo($user->id, null);
}
// this holds the info of profile viewer
$config = JblanceHelper::getConfig();
$enableReporting = $config->enableReporting;
$enableAddThis = $config->enableAddThis;
$addThisPubid = $config->addThisPubid;