Esempio n. 1
0
 /**
  * Allows caller to log the user out from the site
  *
  * @since	1.3
  * @access	public
  */
 public function logout()
 {
     JSession::checkToken('request') or jexit(JText::_('JInvalid_Token'));
     // Perform the logout
     $error = $this->app->logout();
     // Check if the log out succeeded.
     if (!$error instanceof Exception) {
         // Get the return url from the request and validate that it is internal.
         $return = JRequest::getVar('return', '', 'method', 'base64');
         $return = base64_decode($return);
         if (!JUri::isInternal($return)) {
             $return = '';
         }
         // Redirect the user.
         $this->app->redirect(JRoute::_($return, false));
         $this->app->close();
     }
     $this->app->redirect(FRoute::login(array(), false));
 }
Esempio n. 2
0
        <table align="center" width="380" style="margin-top:-10px" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="color:#888;border-top: 1px solid #ebebeb;padding: 15px 20px; background-color:#f8f9fb;font-size:13px;text-align:center">
                    <?php 
echo JText::_('COM_EASYSOCIAL_EMAILS_USERNAME');
?>
: <?php 
echo $username;
?>
                </td>
            </tr>
        </table>

        <a href="<?php 
echo FRoute::login(array('external' => true));
?>
" style="
        display:inline-block;
        text-decoration:none;
        font-weight:bold;
        margin-top: 20px;
        padding:10px 15px;
        line-height:20px;
        color:#fff;font-size: 12px;
        background-color: #83B3DD;
        background-image: linear-gradient(to bottom, #91C2EA, #6D9CCA);
        background-repeat: repeat-x;
        border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
        text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
        border-style: solid;
Esempio n. 3
0
 /**
  * Renders a login page if necessary. If this is called via an ajax method, it will trigger a dialog instead.
  *
  * @access	public
  * @param	null
  * @return	string	Contents.
  */
 public static function requireLogin()
 {
     $document = JFactory::getDocument();
     $my = FD::user();
     if ($my->id > 0) {
         return true;
     }
     switch ($document->getType()) {
         case 'html':
             // Do some redirects here?
             $info = FD::info();
             $message = new stdClass();
             $message->message = JText::_('COM_EASYSOCIAL_PLEASE_LOGIN_FIRST');
             $message->type = SOCIAL_MSG_INFO;
             $info->set($message);
             // Get the application framework.
             $app = JFactory::getApplication();
             // Get the current URI.
             $callback = FRoute::current();
             FD::setCallback($callback);
             $url = FRoute::login(array(), false);
             $app->redirect($url);
             $app->close();
             break;
         case 'ajax':
             $ajax = FD::ajax();
             // Get the referer URI.
             $callback = FRoute::referer();
             if ($callback) {
                 FD::setCallback($callback);
             }
             $ajax->script('EasySocial.login();');
             return $ajax->send();
             break;
     }
 }
Esempio n. 4
0
 public static function getLoginLink($returnURL = '')
 {
     $config = EasyBlogHelper::getConfig();
     if (!empty($returnURL)) {
         $returnURL = '&return=' . $returnURL;
     }
     $default = EBR::_('index.php?option=com_user&view=login' . $returnURL);
     if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
         $default = EBR::_('index.php?option=com_users&view=login' . $returnURL);
     }
     switch ($config->get('main_login_provider')) {
         case 'easysocial':
             $easysocial = EasyBlogHelper::getHelper('EasySocial');
             if ($easysocial->exists()) {
                 $link = FRoute::login();
             } else {
                 $link = $default;
             }
             break;
         case 'cb':
             $link = JRoute::_('index.php?option=com_comprofiler&task=login' . $returnURL);
             break;
             break;
         case 'joomla':
         case 'jomsocial':
             $link = $default;
             break;
     }
     return $link;
 }
Esempio n. 5
0
 /**
  * Responsible to log the user out from the system.
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function logout()
 {
     $my = FD::user();
     // Determine if there's a login redirection
     $config = FD::config();
     $logoutMenu = $config->get('general.site.logout');
     // Default redirection url
     $redirect = FRoute::login(array(), false);
     if ($loginMenu != 'null') {
         $redirect = FD::get('toolbar')->getRedirectionUrl($logoutMenu);
     }
     if (!$my->id) {
         return $this->redirect($redirect);
     }
     // Try to log the user out.
     $app = JFactory::getApplication();
     // Perform the log out.
     $error = $app->logout();
     // Get the return URL
     return $this->redirect($redirect);
 }
Esempio n. 6
0
 /**
  * Responsible for post-processing of activation
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function activate($user = null)
 {
     FD::info()->set($this->getMessage());
     if ($this->hasErrors()) {
         $url = FRoute::registration(array('layout' => 'activation', 'userid' => $user->id), false);
         return $this->redirect($url);
     }
     return $this->redirect(FRoute::login(array(), false));
 }
Esempio n. 7
0
 /**
  * Redirects users view to easysocial
  *
  * @since	1.0
  * @access	public
  * @return
  */
 public function processUsersRedirection()
 {
     $doc = JFactory::getDocument();
     if ($doc->getType() != 'html') {
         return;
     }
     // Check if the admin wants to enable this
     if (!$this->params->get('redirection', true)) {
         return;
     }
     // If this is registration from com_users, redirect to the appropriate page.
     if ($this->isUserRegistration()) {
         // Redirect to EasySocial's registration
         $url = FRoute::registration(array(), false);
         return $this->app->redirect($url);
     }
     // If this is username reminder, redirect to the appropriate page.
     if ($this->isUserRemind()) {
         // Redirect to EasySocial's registration
         $url = FRoute::account(array('layout' => 'forgetUsername'), false);
         return $this->app->redirect($url);
     }
     // If this is password reset, redirect to the appropriate page.
     if ($this->isUserReset()) {
         // Redirect to EasySocial's registration
         $url = FRoute::account(array('layout' => 'forgetPassword'), false);
         return $this->app->redirect($url);
     }
     // If this is password reset, redirect to the appropriate page.
     if ($this->isUserLogin()) {
         // Determine if there's any "return" url in the query string
         $return = JRequest::getVar('return');
         if ($return) {
             FD::setCallback(base64_decode($return));
         }
         // Redirect to EasySocial's registration
         $url = FRoute::login(array(), false);
         return $this->app->redirect($url);
     }
     // If this is password reset, redirect to the appropriate page.
     if ($this->isUserProfile()) {
         // Redirect to EasySocial's registration
         $url = FRoute::profile(array(), false);
         return $this->app->redirect($url);
     }
 }
Esempio n. 8
0
 /**
  * Override parent controller's display behavior.
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function display($params = array(), $urlparams = false)
 {
     $type = $this->doc->getType();
     $name = $this->input->get('view', 'dashboard', 'cmd');
     $view = $this->getView($name, $type, '');
     // @task: Once we have the view, set the appropriate layout.
     $layout = $this->input->get('layout', 'default', 'cmd');
     $view->setLayout($layout);
     // Check and see if this view should be displayed
     // If private mode is enabled and user isn't logged in.
     if ($this->config->get('general.site.lockdown.enabled') && $this->my->guest && $view->lockdown()) {
         $url = FRoute::login(array(), false);
         return $this->app->redirect($url);
     }
     // For ajax methods, we just load the view methods.
     if ($type == 'ajax') {
         if (!method_exists($view, $layout)) {
             $view->display();
         } else {
             $params = $this->input->get('params', '', 'default');
             $params = json_decode($params);
             call_user_func_array(array($view, $layout), $params);
         }
     } else {
         // Disable inline scripts in templates.
         SocialThemes::$_inlineScript = false;
         if ($layout != 'default') {
             if (!method_exists($view, $layout)) {
                 $view->display();
             } else {
                 call_user_func_array(array($view, $layout), $params);
             }
         } else {
             $view->display();
         }
         // Restore inline script in templates.
         SocialThemes::$_inlineScript = true;
     }
 }
Esempio n. 9
0
    ?>

                        <button class="btn btn-es-primary btn-block mb-20" type="button" data-registermini-submit><?php 
    echo JText::_('MOD_EASYSOCIAL_REGISTRATION_REQUESTER_REGISTER_NOW_BUTTON');
    ?>
 &rarr;</button>

                    </form>
                    <?php 
}
?>
                </div>

                <div class="es-cta-login">
                    <?php 
echo JText::_('MOD_EASYSOCIAL_REGISTRATION_REQUESTER_ALREADY_SIGNED_UP');
?>
 <a href="<?php 
echo FRoute::login();
?>
"><?php 
echo JText::_('MOD_EASYSOCIAL_REGISTRATION_REQUESTER_LOGIN_TO_YOUR_ACCOUNT');
?>
</a>
                </div>

            </div>
        </div>
    </content>
</dialog>
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<div class="es-stream-login-box">
    <div>
        <?php 
echo JText::sprintf('COM_EASYSOCIAL_GUEST_STREAM_LOGIN_DESCRIPTION', FRoute::registration());
?>
    </div>
    <div class="mt-15">
		<a class="btn btn-es btn-sm" href="<?php 
echo FRoute::login(array(), false);
?>
"><?php 
echo JText::_('COM_EASYSOCIAL_LOGIN_BUTTON');
?>
</a>
		<?php 
echo JText::_('COM_EASYSOCIAL_GUEST_STREAM_OR');
?>
		<a class="btn btn-es btn-es-primary btn-sm" href="<?php 
echo FRoute::registration();
?>
"><?php 
echo JText::_('COM_EASYSOCIAL_REGISTER_NOW_BUTTON');
?>
</a>
Esempio n. 11
0
 /**
  * Override parent controller's display behavior.
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function display($params = array(), $urlparams = false)
 {
     $doc = JFactory::getDocument();
     // @task: Get the view from Joomla.
     $type = $doc->getType();
     $name = JRequest::getCmd('view', 'dashboard');
     $view = $this->getView($name, $type, '');
     // @task: Once we have the view, set the appropriate layout.
     $layout = JRequest::getCmd('layout', 'default');
     $view->setLayout($layout);
     $config = FD::config();
     // Check and see if this view should be displayed
     // If private mode is enabled and user isn't logged in.
     if ($config->get('general.site.lockdown.enabled') && !JFactory::getUser()->id) {
         if ($view->lockdown()) {
             JFactory::getApplication()->redirect(FRoute::login(array(), false));
         }
     }
     // For ajax methods, we just load the view methods.
     if ($type == 'ajax') {
         if (!method_exists($view, $layout)) {
             $view->display();
         } else {
             $json = FD::json();
             call_user_func_array(array($view, $viewLayout), $json->decode(JRequest::getVar('params')));
         }
     } else {
         // Disable inline scripts in templates.
         SocialThemes::$_inlineScript = false;
         if ($layout != 'default') {
             if (!method_exists($view, $layout)) {
                 $view->display();
             } else {
                 call_user_func_array(array($view, $layout), $params);
             }
         } else {
             $view->display();
         }
         // Restore inline script in templates.
         SocialThemes::$_inlineScript = true;
     }
 }
Esempio n. 12
0
 /**
  * Post process after user resets the password
  *
  * @since	1.0
  * @access	public
  */
 public function completeResetPassword()
 {
     // Enqueue the message
     FD::info()->set($this->getMessage());
     if ($this->hasErrors()) {
         return $this->redirect(FRoute::account(array('layout' => 'completeReset'), false));
     }
     // If it was successful, redirect user to the login page
     $this->redirect(FRoute::login(array(), false));
 }
Esempio n. 13
0
 /**
  * Responsible to log the user out from the system.
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function logout()
 {
     $logoutMenu = $this->config->get('general.site.logout');
     // Default redirection url
     $redirect = FRoute::login(array(), false);
     if ($loginMenu != 'null') {
         $redirect = FRoute::getMenuLink($logoutMenu);
     }
     // If the user is not logged in on the first place
     if ($this->my->guest) {
         return $this->redirect($redirect);
     }
     // Perform the log out.
     $error = $this->app->logout();
     // Get the return URL
     return $this->redirect($redirect);
 }
// Check if Foundry exists
if (!FD::exists()) {
    FD::language()->loadSite();
    echo JText::_('COM_EASYSOCIAL_FOUNDRY_DEPENDENCY_MISSING');
    return;
}
$my = FD::user();
// Load up the module engine
$modules = FD::modules('mod_easysocial_stream');
// We need foundryjs here
$modules->loadComponentScripts();
$modules->loadComponentStylesheets();
// We need these packages
$modules->addDependency('css', 'javascript');
// Get the layout to use.
$layout = $params->get('layout', 'default');
$suffix = $params->get('suffix', '');
$total = $params->get('total', 10);
// Get the layout to use.
$stream = FD::stream();
$stream->getPublicStream($total);
$readmoreURL = '';
$readmoreText = '';
if ($my->id == 0) {
    $readmoreURL = FRoute::login(array(), false);
    $readmoreText = JText::_('MOD_EASYSOCIAL_STREAM_LOGIN');
} else {
    $readmoreURL = FRoute::dashboard(array(), false);
    $readmoreText = JText::_('MOD_EASYSOCIAL_STREAM_GOTO_DASHBOARD');
}
require JModuleHelper::getLayoutPath('mod_easysocial_stream', $layout);
Esempio n. 15
0
	public function getLoginLink( $returnURL = '' )
	{
		$config 	= Komento::getConfig();

		if( !empty( $returnURL ) )
		{
			$returnURL	= '&return=' . $returnURL;
		}

		$link = JRoute::_('index.php?option=com_users&view=login' . $returnURL );

		switch( $config->get( 'login_provider' ) )
		{
			case 'cb':
				$link 	= JRoute::_( 'index.php?option=com_comprofiler&task=login' . $returnURL);
				break;
			break;

			case 'joomla':
			case 'jomsocial':
				if( Komento::isJoomla15() )
				{
					$link	= JRoute::_( 'index.php?option=com_user&view=login' . $returnURL );
				}
				else
				{
					$link 	= JRoute::_('index.php?option=com_users&view=login' . $returnURL );
				}
			break;

			case 'easysocial':
				$es = Komento::getHelper( 'EasySocial' );

				if( $es->exists() )
				{
					$link = FRoute::login();
				}
			break;
		}

		return $link;
	}