Before rendering this page, identify the correct URL for the login to post
        to, and the error message to display (if any), and fill the 'login
        action' and 'error' slots in the template accordingly.
170933
def beforeRender(self, ctx):
        
        generator = ixmantissa.ISiteURLGenerator(self.store)
        url = generator.rootURL(IRequest(ctx))
        url = url.child('__login__')
        for seg in self.segments:
            url = url.child(seg)
        for queryKey, queryValues in self.arguments.iteritems():
            for queryValue in queryValues:
                url = url.add(queryKey, queryValue)

        req = inevow.IRequest(ctx)
        err = req.args.get('login-failure', ('',))[0]

        if 0 < len(err):
            error = inevow.IQ(
                        self.fragment).onePattern(
                                'error').fillSlots('error', err)
        else:
            error = ''

        ctx.fillSlots("login-action", url)
        ctx.fillSlots("error", error)
1040447
def post(self, request, *args, **kwargs):
        
        self.object = self.get_object()
        self.login()
        if self.object.password:
            entry_password = self.request.POST.get('entry_password')
            if entry_password:
                if entry_password == self.object.password:
                    self.request.session[self.session_key %
                                         self.object.pk] = self.object.password
                    return self.get(request, *args, **kwargs)
                else:
                    self.error = True
            return self.password()
        return self.get(request, *args, **kwargs)
1303093
function (req, res) {
    var error = new errors.NotFound('Page Does Not Exist');
    if (req.accepts('html') && (req.url.indexOf('/api/') !== 0)) {
      this.renderErrorPage('404', error, req, res);
    } else {
      this.renderError(error, req, res);
    }
  }
897720
def before_render(self):
        
        # We want to display the nav tabs, so we do NOT want disable_border in
        # the request. Thus, do not call super.before_render

        mtool = api.get_tool("portal_membership")
        if not mtool.checkPermission(AddAnalysisSpec, self.context):
            del self.context_actions[_("Add")]
965146
public function editAction()
    {
        $model = $this->loadModel();
        if ($model->isObjectNew()) {
            $this->_forward('noroute');
            return;
        }

        if ($this->getRequest()->isPost()) {
            $postData = $this->getRequest()->getPost();
            try {
                foreach ($this->preprocessPostData($postData) as $key => $value) {
                    $model->setDataUsingMethod($key, $value);
                }
                $model->save();
                $this->_redirectUrl($this->getHelper()->getGridUrl());
                $this->_getSession()->addSuccess('Saved Successfully');
                return;
            } catch (Exception $e) {
                if ($e instanceof Zend_Db_Statement_Exception && $e->getChainedException() instanceof PDOException) {
                    $e = $e->getChainedException();
                }
                Mage::logException($e);
                $this->_getSession()->addError($e->getMessage());
            }
        }

        $this->loadLayout();
        $this->renderLayout();
    }
745539
public function actionLogin()
	{
		$model=Yii::createComponent('gii.models.LoginForm');

		// collect user input data
		if(isset($_POST['LoginForm']))
		{
			$model->attributes=$_POST['LoginForm'];
			// validate user input and redirect to the previous page if valid
			if($model->validate() && $model->login())
				$this->redirect(array('index'));
		}
		// display the login form
		$this->render('login',array('model'=>$model));
	}
1164202
def login(self, **kwargs):
        
        assert self.LOGIN_URL_PATH is not None

        render_name = kwargs.pop("render", "json")
        render = get_renderer(render_name)
        params = parse_args(**kwargs)
        return self.post(self.LOGIN_URL_PATH, body_params=params, render=render)
1179055
protected function initLoginRequired()
    {
        $routeInfo = Lb::app()->getRouteInfo();
        if (!in_array($routeInfo['controller'], Route::KERNEL_WEB_CTR) 
            || !in_array($routeInfo['action'], Route::KERNEL_WEB_ACTIONS)
        ) {
            $login_required_filter = Lb::app()->getLoginRequiredFilter();
            if (!isset($login_required_filter['controllers'][$routeInfo['controller']][$routeInfo['action']]) 
                || !$login_required_filter['controllers'][$routeInfo['controller']][$routeInfo['action']]
            ) {
                $login_default_url = Lb::app()->getLoginDefaultUrl();
                if (Lb::app()->isLoginRequired() && $login_default_url) {
                    Lb::app()->loginRequired($login_default_url);
                }
            }
        }
    }
1298565
public function on_before_render()
    {
        $pageTitle = $this->get('pageTitle');
        if (!$pageTitle) {
            $this->set('pageTitle', t($this->c->getCollectionName()));
        }
        $dbConfig = $this->app->make('config/database');
        $this->set('showPrivacyPolicyNotice', !$dbConfig->get('app.privacy_policy_accepted'));
        $this->set('token', $this->token);
        $this->set('error', $this->error);
    }
72053
public function checkIsLogin()
    {
        if (!$this->di->get("session")->has("user")) {
            $views = [
                ["comment/user/fail/fail", [], "main"]
            ];
            $this->di->get("pageRenderComment")->renderPage([
                "views" => $views,
                "title" => "Not logged in"
            ]);
        }
    }
79739
def render_page(url, status)
      # get content - if the admin isn't logged in your add the extra status requirements
      if !current_user.blank? && !params[:admin_preview].blank? && params[:admin_preview] == 'true'
        @content = Post.where("post_type = 'page' AND post_visible = 'Y' AND (post_status = 'Published' OR post_status = 'Draft')").find_by_structured_url("/#{url}")
      else
        @content = Post.where(status + " AND post_type = 'page' AND post_visible = 'Y'").find_by_structured_url("/#{url}")
      end

      # add a breadcrumb for each of its parents by running through each segment
      url.split('/').each do |u|
        p = Post.where(:post_type => 'page').find_by_post_slug(u)
        if p
          add_breadcrumb "#{p.post_title.capitalize}", "#{p.structured_url}", :title => "Back to #{p.post_title.capitalize}"
        end
      end
      # if content if blank return a 404
      render_404 and return if @content.blank?
      gloalize @content

      # if the content id is the same as the home page redirect to the home page do not render the content
      if !Setting.get('home_page').blank? && Setting.get('home_page').to_i == @content.id
        redirect_to site_url
      else
        render_template 'page'
      end

    end
1003602
public function UserPage()
	{
		$this->RequirePermission(ExampleUser::$PERMISSION_USER, 
				'SecureExample.LoginForm', 
				'Login is required to access the secure user page',
				'You do not have permission to access the secure user page');
		
		$this->Assign("currentUser", $this->GetCurrentUser());
		
		$this->Assign('page','userpage');
		$this->Render("SecureExample");
	}
1201685
def new
      # Before displaying the login form, make sure an external auth system shouldn't be used.
      auth_url = ::Incline::UserManager.begin_external_authentication(request)
      redirect_to auth_url unless auth_url.blank?
    end
848705
protected function before_user_func()
    {
        if ($this->config['error_reporting'] !== false) {
            set_error_handler(sprintf('%s::error_handler', __CLASS__), $this->config['error_reporting']);
        }

        if (empty($_POST['phery']['csrf'])) {
            $_POST['phery']['csrf'] = '';
        }

        if ($this->csrf($_POST['phery']['csrf']) === false) {
            self::exception($this, 'Invalid CSRF token', self::ERROR_CSRF);
        }
    }
789702
def login(self, request, extra_context=None):
        
        from django.contrib.auth.views import login
        context = {
            'title': _('Log in'),
            'app_path': request.get_full_path(),
            REDIRECT_FIELD_NAME: request.get_full_path(),
        }
        context.update(extra_context or {})
        defaults = {
            'extra_context': context,
            'authentication_form': self.login_form or AdminAuthenticationForm,
            'template_name': self.login_template or 'cms/login.html',
        }
        return login(request, **defaults)
719667
def rescue_http_error(exception)
      # we need to call it before we assign the variables
      body = self.render_http_error(exception)
      [exception.status, exception.headers, body]
    end
311756
function _account_page_render() {
            $this->_logger->entrance();

            $template = 'account.php';
            $vars     = array( 'id' => $this->_module_id );

            /**
             * Added filter to the template to allow developers wrapping the template
             * in custom HTML (e.g. within a wizard/tabs).
             *
             * @author Vova Feldman (@svovaf)
             * @since  1.2.1.6
             */
            echo $this->apply_filters( "templates/{$template}", fs_get_template( $template, $vars ) );
        }