Returns the html for the token reset confirmation box
@return string html
504811
public function user_reset_rss_token_confirmation() {
        global $OUTPUT, $CFG;
        $managetokenurl = $CFG->wwwroot."/user/managetoken.php?sesskey=" . sesskey();
        $optionsyes = array('action' => 'resetrsstoken', 'confirm' => 1, 'sesskey' => sesskey());
        $optionsno  = array('section' => 'webservicetokens', 'sesskey' => sesskey());
        $formcontinue = new single_button(new moodle_url($managetokenurl, $optionsyes), get_string('reset'));
        $formcancel = new single_button(new moodle_url($managetokenurl, $optionsno), get_string('cancel'), 'get');
        $html = $OUTPUT->confirm(get_string('resettokenconfirmsimple', 'webservice'), $formcontinue, $formcancel);
        return $html;
    }
153071
public function showResetForm($token = null)
    {
        if (is_null($token)) {
            return $this->showLinkRequestForm();
        }

        $email = Request::input('email');

        set_meta('title', trans('orchestra/foundation::title.reset-password'));

        return view('orchestra/foundation::forgot.reset', compact('email', 'token'));
    }
637364
public function user_rss_token_box($token) {
        global $OUTPUT, $CFG;

        // Display strings.
        $stroperation = get_string('operation', 'webservice');
        $strtoken = get_string('key', 'webservice');

        $return = $OUTPUT->heading(get_string('rss', 'rss'), 3, 'main', true);
        $return .= $OUTPUT->box_start('generalbox webservicestokenui');

        $return .= get_string('rsskeyshelp');

        $table = new html_table();
        $table->head  = array($strtoken, $stroperation);
        $table->align = array('left', 'center');
        $table->width = '100%';
        $table->data  = array();

        if (!empty($token)) {
            $reset = "<a href=\"".$CFG->wwwroot."/user/managetoken.php?sesskey=".sesskey().
                    "&amp;action=resetrsstoken\">".get_string('reset')."</a>";

            $table->data[] = array($token, $reset);

            $return .= html_writer::table($table);
        } else {
            $return .= get_string('notoken', 'webservice');
        }

        $return .= $OUTPUT->box_end();
        return $return;
    }
809856
public function showReset(string $reset_code = null)
    {
        if ($reset_code === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('login-page') . "?m=3");
            } else {
                return 'Redirect: ' . $this->router->generate('login-page') . "?m=3";
            }
        }
        $user = Model\User::where("reset_code", $reset_code)->first();
        if ($user === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('login-page') . "?m=3");
            } else {
                return 'Redirect: ' . $this->router->generate('login-page') . "?m=3";
            }
        }

        return $this->templates->render("Auth::Reset", [
            "messages" => [
                'error' => '',
                'info' => '',
                'success' => '',
                'warning' => ''
            ]
        ]);
    }
1311496
function confirmation() {
    if (isset($_POST['authorizenet_cc_number'])) {
      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
                            'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER,
                                                    'field' => $_POST['authorizenet_cc_owner']),
                                              array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER,
                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                              array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES,
                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$_POST['authorizenet_cc_expires_month'], 1, '20' . $_POST['authorizenet_cc_expires_year'])))));
    } else {
      $confirmation = array(); //array('title' => $this->title);
    }
    return $confirmation;
  }
861483
public function httpPostDeleteForHtml()
    {
        $isConfirmed = $this->getRequest()->getParameter('confirm') == 1;

        $response = null;
        if ($isConfirmed) {
            // If the operation has been confirmed, proceed.
            $response = $this->getDeletionResponse(
                $this->getRequest()->getParameter('ids')
            );
        } else {
            // If the operation is not confirmed, request confirmation.
            $selectedIds = $this->getSelectedIds();
            $response = $this->getDeletionConfirmationResponse($selectedIds);
        }

        return $response;
    }
277652
public function getHtml()
  {
    $html = "";

    $table_classes = $this->getTableClasses();

    if($this->table_responsive)
    {
      $html.= "<div class=\"table-responsive\">\n";
    }

    $id_tag = $this->getTagId();

    $html.= "<table {$id_tag} class=\"table {$table_classes}\">\n";

    // table header
    if( isset($this->header) )
    {
        $html.= "\t<thead>\n";
        $html.= $this->header->getHtml();
        $html.= $this->fillWithEmptyCells($this->header, $this->header->getTagRow() );
        $html.= "\t</thead>\n";
    }

    // table data
    if( isset($this->rows))
    {
      $html.= "\t<tbody>\n";
      foreach($this->rows as $row)
      {
        $html.= $row->getHtml();
        $html.= $this->fillWithEmptyCells($row, $row->getTagRow() );
      }
      $html.= "\t</tbody>\n";
    }

    $html.= "</table>\n";

    if($this->table_responsive)
    {
      $html.= "</div>\n";
    }

    return $html;
  }
764581
public function resetAction()
    {
        $token = $this->get('request_stack')->getCurrentRequest()->get('token');
        if (!$token) {
            return $this->render('FOMUserBundle:Login:error-notoken.html.twig');
        }

        $user = $this->getDoctrine()->getRepository("FOMUserBundle:User")->findOneByResetToken($token);
        if (!$user) {
            $mail = $this->container->getParameter('fom_user.mail_from_address');
            return $this->render('FOMUserBundle:Login:error-notoken.html.twig', array(
                'site_email' => $mail));
        }

        $max_token_age = $this->container->getParameter("fom_user.max_reset_time");
        if (!$this->checkTimeInterval($user->getResetTime(), $max_token_age)) {
            $form = $this->createForm('form');
            return $this->render('FOMUserBundle:Login:error-tokenexpired.html.twig', array(
                'user' => $user,
                'form' => $form->createView()
            ));
        }

        $form = $this->createForm(new UserResetPassType(), $user);
        return array(
            'user' => $user,
            'form' => $form->createView());
    }
990937
public function getReset($token = null) {
        if (is_null($token))
        {
            throw new NotFoundHttpException;
        }

        //return view('usermanagement::auth.reset')->with('token', $token);
        return view('usermanagement::frontend.'.$this->frontend_template_name.'.password.reset', [
            'title' => 'Reset Password',
            'token' => $token,
        ]);
    }
1171611
public function getReportRulesElement()
    {
        $element = $this->getElement($this->_reportRulesFieldName);

        if (! $element) {
            $info = $this->user->reportPasswordWeakness();

            // Show password info
            if ($info) {
                $element = new \MUtil_Form_Element_Html($this->_reportRulesFieldName);
                $element->setLabel($this->_('Password rules'));

                if (1 == count($info)) {
                    $element->div(sprintf($this->_('A password %s.'), reset($info)));
                } else {
                    foreach ($info as &$line) {
                        $line .= ';';
                    }
                    $line[strlen($line) - 1] = '.';

                    $element->div($this->_('A password:'))->ul($info);
                }
                $this->addElement($element);
            }
        }

        return $element;
    }
245361
public function confirmAction()
    {
        $token = $this->get('request_stack')->getCurrentRequest()->get('token');
        if(!$token) {
            return $this->render('FOMUserBundle:Login:error-notoken.html.twig');
        }

        // Lookup token
        $user = $this->getDoctrine()->getRepository("FOMUserBundle:User")->findOneByRegistrationToken($token);
        if(!$user) {
            $mail = $this->container->getParameter('fom_user.mail_from_address');
            return $this->render('FOMUserBundle:Login:error-notoken.html.twig', array(
                'site_email' => $mail));
        }

        // Check token age
        $max_registration_age = $this->container->getParameter("fom_user.max_registration_time");
        if(!$this->checkTimeInterval($user->getRegistrationTime(), $max_registration_age)) {
            $form = $this->createForm('form');
            return $this->render('FOMUserBundle:Login:error-tokenexpired.html.twig', array(
                'user' => $user,
                'form' => $form->createView()
            ));
        }

        // Unset token
        $em = $this->getDoctrine()->getManager();
        $user->setRegistrationToken(null);
        $em->flush();

        // Forward to final page
        return $this->redirect($this->generateUrl('fom_user_registration_done'));
    }
75776
private function renderCsrfToken() {
		
		$tokenManager = new CsrfTokenManager();
		$token = $tokenManager->refreshToken('_' . $this->action . '_');

		$e = new InputElement(self::CSRF_TOKEN_NAME, $token->getValue());
		$e->setAttribute('type', 'hidden');
		
		return $e->render();
	}
1195598
protected function script()
    {
        $deleteConfirm = trans('admin.delete_confirm');
        $saveSucceeded = trans('admin.save_succeeded');
        $refreshSucceeded = trans('admin.refresh_succeeded');
        $deleteSucceeded = trans('admin.delete_succeeded');
        $confirm = trans('admin.confirm');
        $cancel = trans('admin.cancel');

        $nestableOptions = json_encode($this->nestableOptions);

        return <<<SCRIPT

        $('#{$this->elementId}').nestable($nestableOptions);

        $('.tree_branch_delete').click(function() {
            var id = $(this).data('id');
            swal({
              title: "$deleteConfirm",
              type: "warning",
              showCancelButton: true,
              confirmButtonColor: "#DD6B55",
              confirmButtonText: "$confirm",
              closeOnConfirm: false,
              cancelButtonText: "$cancel"
            },
            function(){
                $.ajax({
                    method: 'post',
                    url: '{$this->path}/' + id,
                    data: {
                        _method:'delete',
                        _token:LA.token,
                    },
                    success: function (data) {
                        $.pjax.reload('#pjax-container');

                        if (typeof data === 'object') {
                            if (data.status) {
                                swal(data.message, '', 'success');
                            } else {
                                swal(data.message, '', 'error');
                            }
                        }
                    }
                });
            });
        });

        $('.{$this->elementId}-save').click(function () {
            var serialize = $('#{$this->elementId}').nestable('serialize');

            $.post('{$this->path}', {
                _token: LA.token,
                _order: JSON.stringify(serialize)
            },
            function(data){
                $.pjax.reload('#pjax-container');
                toastr.success('{$saveSucceeded}');
            });
        });

        $('.{$this->elementId}-refresh').click(function () {
            $.pjax.reload('#pjax-container');
            toastr.success('{$refreshSucceeded}');
        });

        $('.{$this->elementId}-tree-tools').on('click', function(e){
            var target = $(e.target),
                action = target.data('action');
            if (action === 'expand') {
                $('.dd').nestable('expandAll');
            }
            if (action === 'collapse') {
                $('.dd').nestable('collapseAll');
            }
        });


SCRIPT;
    }
654212
public function GetActiveSettingAsHiddenInputField()
    {
        $sHTML = '';
        if (is_array($this->aActiveFilterData)) {
            reset($this->aActiveFilterData);
            foreach ($this->aActiveFilterData as $sItemName) {
                $sHTML .= '<input type="hidden" name="'.TGlobal::OutHTML($this->GetURLInputName()).'[]" value="'.TGlobal::OutHTML($sItemName).'" />';
            }
            reset($this->aActiveFilterData);
        }

        return $sHTML;
    }
259447
protected function ResetPasswordConfirm()
	{
		$myWords = $this->WordCollection();

		if (!$this->_login->getCanRetrievePassword())
		{
			$this->FormLogin();
			return;
		}
		elseif ($this->_login->getPassword() == "" || $this->_context->get('password2') == "")
		{
			$container = new XmlnukeUIAlert($this->_context, UIAlert::BoxAlert);
			$container->setAutoHide(5000);
			$container->addXmlnukeObject(new XmlnukeText($myWords->Value("PASSWORDISREQUIRED"), true));
			$this->_blockCenter->addXmlnukeObject($container);

			$this->ResetPassword();
			return;
		}
		elseif ($this->_login->getPassword() != $this->_context->get('password2'))
		{
			$container = new XmlnukeUIAlert($this->_context, UIAlert::BoxAlert);
			$container->setAutoHide(5000);
			$container->addXmlnukeObject(new XmlnukeText($myWords->Value("PASSWORDNOTMATCH"), true));
			$this->_blockCenter->addXmlnukeObject($container);

			$this->ResetPassword();
			return;
		}

		$user = $this->_users->getUserName( $this->_login->getUsername() );

		$tokenValid = $user->getField("TOKEN_PWD_RESET") == $this->_login->getResetToken()
				&& $user->getField("TOKEN_PWD_RESET_VALID") >= DateUtil::Today(DATEFORMAT::YMD);

		if (is_null($user) || !$tokenValid)
		{
			$this->FormLogin();
		}
		elseif ($user->getField("TOKEN_PWD_RESET") != $this->_login->getResetToken())
		{
			$container = new XmlnukeUIAlert($this->_context, UIAlert::BoxAlert);
			$container->setAutoHide(5000);
			$container->addXmlnukeObject(new XmlnukeText($myWords->Value("RESETINVALIDTOKEN"), true));
			$this->_blockCenter->addXmlnukeObject($container);

			$this->FormLogin();
			return;
		}
		else
		{
			$newpassword = $this->_users->getSHAPassword($this->_login->getPassword());
			$user->setField('TOKEN_PWD_RESET', '');
			$user->setField('TOKEN_PWD_RESET_VALID', '');
			$user->setField($this->_users->getUserTable()->password, $newpassword);
			$this->_users->Save();
			$container = new XmlnukeUIAlert($this->_context, UIAlert::ModalDialog, "");
			$container->addRedirectButton($myWords->Value("TXT_BACK"), $this->_login->getReturnUrl());
			$container->addXmlnukeObject(new XmlnukeText($myWords->Value("RESETPASSWORDOK"), true));
			$this->_blockCenter->addXmlnukeObject($container);
			$this->FormLogin();
		}
	}
431460
protected function getCsrfToken(): ?string
    {
        if (is_null($this->csrfToken)) {
            $this->csrfToken = $this->app->make('session')->token();
        }

        return $this->csrfToken;
    }
490716
public function getHTML()
    {
        $details = $this->getHTMLDetails();
        extract($details);
        
        $name = " name='{$this['name']}[]'";
        $options = null;
        $selectedValues = is_array($this['checked']) ? $this['checked'] : [];
        
        foreach ($this['options'] as $optValue => $optText) {
            $selected = in_array($optValue, $selectedValues)
                ? " selected"
                : null;
            $options .= "<option value='{$optValue}'{$selected}>{$optText}</option>\n";
        }

        return <<<EOD
<p>
<label for='$id'>$label</label>$brAfterLabel
<select id='$id'{$size}{$class}{$name}{$autofocus}{$required}{$readonly}{$title} multiple>
{$options}
</select>
{$messages}
</p>
<p class='cf-desc'>{$description}</p>
EOD;
    }