Returns a link to the login page

@return \MUtil_Form_Element_Html
175165
public function getLoginLinkElement()
    {
        $element = $this->getElement($this->_tokenFieldName);

        if (! $element) {
            // Login link
            if ($link = $this->getLoginLink()) {
                $element = new \MUtil_Form_Element_Html($this->_loginLinkFieldName);
                // $element->br();
                $element->setValue($link);

                $this->addElement($element);
            }

            return $element;
        }
    }
312110
public function link(Form\Element\Link $element)
    {

        $html = '<label>' . $element->getLabel() . '</label>';
        $html .= '<p>' . html('a', ['href' => $element->getValue(), 'target' => '_blank'], $element->getValue()) . '</p>';

        $class = Style::FORM_GROUP_CLASS;
        $html = html('div', compact('class'), $html);

        return $html;
    }
636302
public function print_login() {
        $url = $this->skydrive->get_login_url();

        if ($this->options['ajax']) {
            $popup = new stdClass();
            $popup->type = 'popup';
            $popup->url = $url->out(false);
            return array('login' => array($popup));
        } else {
            echo '<a target="_blank" href="'.$url->out(false).'">'.get_string('login', 'repository').'</a>';
        }
    }
193153
public function getURL()
    {
        $p = $this->recall('page');

        // If there is a login page, no need to return to it
        if ($p == 'login') {
            return $this->app->url('/');
        }

        $url = $this->app->url($p, $this->recall('args', null));
        $this->forget('page');
        $this->forget('args');

        return $url;
    }
1205975
public function getLogin()
    {
        if ($this->guard()->check()) {
            return redirect($this->redirectPath());
        }

        return view($this->loginView);
    }
1187906
public function render(): string
    {
        $this->tags();

        if ($this->isLink === true) {
            $this->html .= "<a href=\"{$this->link}\">";
        }

        $element_attributes = '';
        foreach ($this->element_attributes as $attribute => $value) {
            if ($attribute == "color") {
                $element_attributes .= "style=\"{$attribute}: $value\"";
            } else {
                $element_attributes .= "{$attribute}=\"{$value}\" ";
            }
        }

        foreach ($this->tags as $i => $tag) {
            if ($i === 0 && strlen($element_attributes) > 0) {
                $this->html .= "<{$tag} " . rtrim($element_attributes) . '>';
            } else {
                $this->html .= "<{$tag}>";
            }
        }

        $this->html .= $this->escape($this->insert);

        foreach (array_reverse($this->tags) as $tag) {
            $this->html .= "</{$tag}>";
        }

        if ($this->isLink === true) {
            $this->html .= '</a>';
        }

        return $this->html;
    }
857749
public function getRepeatPasswordElement()
    {
        $element = $this->getElement($this->_repeatPasswordFieldName);

        if (! $element) {
            // Field repeat password
            $element = new \Zend_Form_Element_Password($this->_repeatPasswordFieldName);
            $element->setLabel($this->_('Repeat password'));
            $element->setAttrib('size', 40);
            $element->setRequired(true);
            $element->setRenderPassword(true);

            $validator = new \MUtil_Validate_IsConfirmed($this->_newPasswordFieldName, $this->_('New password'));
            $validator->setMessage(
                    $this->_("Must be the same as %fieldDescription%."),
                    \MUtil_Validate_IsConfirmed::NOT_SAME
                    );
            $element->addValidator($validator);

            $this->addElement($element);
        }

        return $element;
    }
1288881
public function getLogin()
    {

        if (null !== Auth::user()) {
            return redirect()->intended($this->redirectPath());
        }

        $page_title = "Login";

        return view('backend::auth.login', compact('page_title'));
    }
746343
public function loginAction()
	{
		$csrf_token = $this->has('security.csrf.token_manager')
			? $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue()
			: null;
		
		$auth_utils = $this->get("security.authentication_utils");
		
		if ($auth_utils->getLastAuthenticationError()) {
			$this->addFlash("error-flash", "Your login or password are incorrect");
		}
		
		// last username entered by the user
		$last_username = $auth_utils->getLastUsername();
		
		return $this->render('@RibsAdmin/login/login.html.twig', array(
			'last_username' => $last_username,
			'csrf_token' => $csrf_token,
		));
	}
481930
public function redirectBackToForm()
    {
        $pageURL = $this->getReturnReferer();
        if (!$pageURL) {
            return $this->redirectBack();
        }

        // Add backURL and anchor
        $pageURL = Controller::join_links(
            $this->addBackURLParam($pageURL),
            '#' . $this->form->FormName()
        );

        // Redirect
        return $this->redirect($pageURL);
    }
239918
public function loginWithAction()
    {
        $return = $this->getReturnUri();
        $auth   = $this->getServiceLocator()
                       ->get( 'Zend\Authentication\AuthenticationService' );

        if ( $auth->hasIdentity() )
        {
            return $this->redirect()
                        ->toUrl( $this->getValidReturnUri( $return ) );
        }

        $request = $this->getRequest();
        $data    = $request->getQuery()
                           ->toArray();

        if ( $request->isPost() )
        {
            $data = array_merge( $data, $request->getPost()
                                                ->toArray() );
        }

        /* @var $sessm \Zend\Session\SessionManager */
        /* @var $logger \Zork\Log\LoggerManager */
        $sessm  = $this->getSessionManager();
        $logger = $this->getServiceLocator()
                       ->get( 'Zork\Log\LoggerManager' );
        $result = $this->getServiceLocator()
                       ->get( 'Grid\User\Authentication\Service' )
                       ->login( $data, $sessm, $auth );

        $messages   = $result->getMessages();
        $with       = empty( $messages['loginWith'] )
                    ? 'other'
                    : $messages['loginWith'];

        if ( $result->isValid() )
        {
            $sessm->regenerateId( false );

            $this->messenger()
                 ->add( 'user.form.login.success',
                        'user', Message::LEVEL_INFO );

            if ( $logger->hasLogger( 'application' ) )
            {
                $logger->getLogger( 'application' )
                       ->notice( 'user-login', array(
                           'successful' => true,
                           'loginWith'  => $with,
                       ) );
            }
        }
        else
        {
            foreach ( $messages as $index => $message )
            {
                if ( is_int( $index ) && is_string( $message ) )
                {
                    $this->messenger()
                         ->add( $message, false, Message::LEVEL_WARN );
                }
            }

            $this->messenger()
                 ->add( $this->getErrorMessageKey( $result->getCode() ),
                        'user', Message::LEVEL_ERROR );

            if ( $logger->hasLogger( 'application' ) )
            {
                $logger->getLogger( 'application' )
                       ->warn( 'user-login', array(
                           'successful' => false,
                           'loginWith'  => $with,
                       ) );
            }
        }

        if ( ! empty( $messages['registered'] ) )
        {
            $user = $result->getIdentity();

            $this->getServiceLocator()
                 ->get( 'Grid\Mail\Model\Template\Sender' )
                 ->prepare( array(
                     'template' => 'user.login-with',
                     'locale'   => $user->locale,
                 ) )
                 ->send( array(
                     'email'        => $user->email,
                     'display_name' => $user->displayName,
                     'confirm_url'  => null,
                 ), array(
                     $user->email   => $user->displayName,
                 ) );
        }

        if ( empty( $messages['returnUri'] ) )
        {
            if ( empty( $data['returnUri'] ) )
            {
                $returnUri = $return;
            }
            else
            {
                $returnUri = $data['returnUri'];
            }
        }
        else
        {
            $returnUri = $messages['returnUri'];
        }

        return $this->redirect()
                    ->toUrl( $this->getValidReturnUri( $returnUri ) );
    }
356721
protected function getEditHtmlSelect()
    {
        /** @var AdminBaseHelper $linkedHelper */
        $linkedHelper = $this->getSettings('HELPER');
        $inputSize = (int) $this->getSettings('INPUT_SIZE');
        $windowWidth = (int) $this->getSettings('WINDOW_WIDTH');
        $windowHeight = (int) $this->getSettings('WINDOW_HEIGHT');

        $name = 'FIELDS';
        $key = $this->getCode();

        $entityData = $this->getOrmElementData();

        if (!empty($entityData)) {
            $elementId = $entityData[$linkedHelper::pk()];
            $elementName = $entityData[$this->getSettings('TITLE_FIELD_NAME')] ?
                $entityData[$this->getSettings('TITLE_FIELD_NAME')] :
                Loc::getMessage('IBLOCK_ELEMENT_NOT_FOUND');
        } else {
            $elementId = '';
        }

        $popupUrl = $linkedHelper::getUrl(array_merge(
            array(
                'popup' => 'Y',
                'eltitle' => $this->getSettings('TITLE_FIELD_NAME'),
                'n' => $name,
                'k' => $key
            ),
            $this->getSettings('ADDITIONAL_URL_PARAMS')
        ));

        return '<input name="' . $this->getEditInputName() . '"
                     id="' . $name . '[' . $key . ']"
                     value="' . $elementId . '"
                     size="' . $inputSize . '"
                     type="text">' .
        '<input type="button"
                    value="..." onClick="jsUtils.OpenWindow(\''. $popupUrl . '\', ' . $windowWidth . ', '
        . $windowHeight . ');">' . '&nbsp;<span id="sp_' . md5($name) . '_' . $key . '" >' .
        static::prepareToOutput($elementName)
        . '</span>';
    }
661879
public function print_login() {
        $url = $this->dropbox->get_login_url();
        if ($this->options['ajax']) {
            $ret = array();
            $btn = new \stdClass();
            $btn->type = 'popup';
            $btn->url = $url->out(false);
            $ret['login'] = array($btn);
            return $ret;
        } else {
            echo html_writer::link($url, get_string('login', 'repository'), array('target' => '_blank'));
        }
    }
1309015
public function getLogoutLink()
    {
        $sClass = $this->getTopActionClassName();
        $sCatnid = $this->getActCatId();
        $sMnfid = $this->getActManufacturerId();
        $sArtnid = $this->getActArticleId();
        $sTplName = $this->getActTplName();
        $sContentLoadId = $this->getActContentLoadId();
        $sSearchParam = $this->getActSearchParam();
        // @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
        $sRecommId = $this->getActRecommendationId();
        // END deprecated
        $sListType = $this->getActListType();

        $oConfig = $this->getConfig();

        return ($oConfig->isSsl() ? $oConfig->getShopSecureHomeUrl() : $oConfig->getShopHomeUrl())
               . "cl={$sClass}"
               . ($sCatnid ? "&amp;cnid={$sCatnid}" : '')
               . ($sArtnid ? "&amp;anid={$sArtnid}" : '')
               . ($sMnfid ? "&amp;mnid={$sMnfid}" : '')
               . ($sSearchParam ? "&amp;searchparam={$sSearchParam}" : '')
               // @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
               . ($sRecommId ? "&amp;recommid={$sRecommId}" : '')
               // END deprecated
               . ($sListType ? "&amp;listtype={$sListType}" : '')
               . "&amp;fnc=logout"
               . ($sTplName ? "&amp;tpl=" . basename($sTplName) : '')
               . ($sContentLoadId ? "&amp;oxloadid=" . $sContentLoadId : '')
               . "&amp;redirect=1";
    }
619255
public function getLinkMain() {
        if($this->currentPageID()!=0 && $this->class=='CodeBankEditSnippet') {
            return $this->LinkWithSearch(Controller::join_links($this->Link('show'), $this->currentPageID()));
        }else if($this->currentPageID()!=0 && $this->class=='CodeBank') {
            $otherID=null;
            if(!empty($this->urlParams['OtherID']) && is_numeric($this->urlParams['OtherID'])) {
                $otherID=intval($this->urlParams['OtherID']);
            }
            
            return $this->LinkWithSearch(Controller::join_links($this->Link('show'), $this->currentPageID(), $otherID));
        }
        
        return $this->LinkWithSearch(singleton('CodeBank')->Link());
    }
424007
public function getForm()
    {
        $elementString = '';

        if (isset($this->attributes[self::$formHolder[self::$formName]])) {
            $elementString .= $this->attributes[self::$formHolder[self::$formName]][self::$formName];
        }

        $elementString .= $this->getHtmlElements();

        $close = null;
        $close = self::$formHolder[self::$formName].'_close';

        if (isset($this->attributes[$close])) {
            $elementString .= $this->attributes[$close];
        }

        return $this->element[self::$formHolder[self::$formName]] = $elementString;
    }
272028
public function LinkingMode()
    {
        /** @var Page_Controller $controller */
        $controller = Controller::curr();
        $params = $controller->getURLParams();

        return $params['ID'] === $this->URLSegment ? 'current' : 'link';
    }